home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd1.bin / zkuste / Perl / ActivePerl-5.6.0.613.msi / 䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥 / _36028d79f75d4cffafeb5907ae7a80d7 < prev    next >
Text File  |  2000-03-23  |  4KB  |  117 lines

  1.  
  2. <HTML>
  3. <HEAD>
  4. <TITLE>File::Copy - Copy files or filehandles</TITLE>
  5. <LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
  6. <LINK REV="made" HREF="mailto:">
  7. </HEAD>
  8.  
  9. <BODY>
  10. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  11. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  12. <STRONG><P CLASS=block> File::Copy - Copy files or filehandles</P></STRONG>
  13. </TD></TR>
  14. </TABLE>
  15.  
  16. <A NAME="__index__"></A>
  17. <!-- INDEX BEGIN -->
  18.  
  19. <UL>
  20.  
  21.     <LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
  22.  
  23.     <LI><A HREF="#usage">USAGE</A></LI>
  24.     <LI><A HREF="#description">DESCRIPTION</A></LI>
  25.     <UL>
  26.  
  27.         <LI><A HREF="#copy">copy</A></LI>
  28.         <LI><A HREF="#copydir">copydir</A></LI>
  29.     </UL>
  30.  
  31.     <LI><A HREF="#see also">SEE ALSO</A></LI>
  32.     <LI><A HREF="#author">AUTHOR</A></LI>
  33. </UL>
  34. <!-- INDEX END -->
  35.  
  36. <HR>
  37. <P>
  38. <H1><A NAME="name">NAME</A></H1>
  39. <P>File::Copy - Copy files or filehandles</P>
  40. <P>
  41. <HR>
  42. <H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
  43. <UL>
  44. <LI>Linux</LI>
  45. <LI>Solaris</LI>
  46. <LI>Windows</LI>
  47. </UL>
  48. <HR>
  49. <H1><A NAME="usage">USAGE</A></H1>
  50. <PRE>
  51.         use File::Copy;</PRE>
  52. <PRE>
  53.         copy("file1","file2");
  54.         copy("Copy.pm",\*STDOUT);'</PRE>
  55. <PRE>
  56.         use POSIX;
  57.         use File::Copy cp;</PRE>
  58. <PRE>
  59.         $n=FileHandle->new("/dev/null","r");
  60.         cp($n,"x");'</PRE>
  61. <P>
  62. <HR>
  63. <H1><A NAME="description">DESCRIPTION</A></H1>
  64. <P>The Copy module provides two functions (copy and copydir)</P>
  65. <P>
  66. <H2><A NAME="copy">copy</A></H2>
  67. <P>The copy function takes two
  68. parameters: a file to copy from and a file to copy to. Either
  69. argument may be a string, a FileHandle reference or a FileHandle
  70. glob. Obviously, if the first argument is a filehandle of some
  71. sort, it will be read from, and if it is a file <EM>name</EM> it will
  72. be opened for reading. Likewise, the second argument will be
  73. written to (and created if need be). If the first argument is
  74. the name of a directory, this function simply calls copydir.</P>
  75. <P>An optional third parameter can be used to specify the buffer
  76. size used for copying. This is the number of bytes from the
  77. first file, that wil be held in memory at any given time, before
  78. being written to the second file. The default buffer size depends
  79. upon the file, but will generally be the whole file (up to 2Mb), or
  80. 1k for filehandles that do not reference files (eg. sockets).</P>
  81. <P>You may use the syntax <CODE>use File::Copy "cp"</CODE> to get at the
  82. ``cp'' alias for this function. The syntax is <EM>exactly</EM> the same.</P>
  83. <P>Return value:</P>
  84. <P>Returns 1 on success, 0 on failure. $! will be set if an error was
  85. encountered.</P>
  86. <P>
  87. <H2><A NAME="copydir">copydir</A></H2>
  88. <P>copydir takes two directory names. If the second directory does
  89. not exist, it will be created. If it does exist, a directory will
  90. be created in it to copy to. Copydir copies every file and directory
  91. from the source directory (first parameter) to the destination
  92. directory (second parameter). The structure of the source directory
  93. will be preserved, and warnings will be issued if a particular file
  94. or directory cannot be accessed or created.</P>
  95. <P>Return value:</P>
  96. <P>copydir returns true on success and false on failure, though failure
  97. to copy a single file or directory from the source tree may still
  98. result in ``success''. The return value simply indicates whether or not
  99. <EM>anything</EM> was done.</P>
  100. <P>
  101. <HR>
  102. <H1><A NAME="see also">SEE ALSO</A></H1>
  103. <P><A HREF="../../../site/lib/File/Tools.html">the File::Tools manpage</A></P>
  104. <P>
  105. <HR>
  106. <H1><A NAME="author">AUTHOR</A></H1>
  107. <P>File::Copy was written by Aaron Sherman <<A HREF="mailto:ajs@ajs.com">ajs@ajs.com</A>> in 1995.</P>
  108. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  109. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  110. <STRONG><P CLASS=block> File::Copy - Copy files or filehandles</P></STRONG>
  111. </TD></TR>
  112. </TABLE>
  113.  
  114. </BODY>
  115.  
  116. </HTML>
  117.