⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 file::copy.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
字号:
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05).\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...de Sp \" Vertical space (when we can't use .PP).if t .sp .5v.if n .sp...de Vb \" Begin verbatim text.ft CW.nf.ne \\$1...de Ve \" End verbatim text.ft R.fi...\" Set up some character translations and predefined strings.  \*(-- will.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left.\" double quote, and \*(R" will give a right double quote.  \*(C+ will.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,.\" nothing in troff, for use with C<>..tr \(*W-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'.ie n \{\.    ds -- \(*W-.    ds PI pi.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch.    ds L" "".    ds R" "".    ds C` "".    ds C' ""'br\}.el\{\.    ds -- \|\(em\|.    ds PI \(*p.    ds L" ``.    ds R" '''br\}.\".\" Escape single quotes in literal strings from groff's Unicode transform..ie \n(.g .ds Aq \(aq.el       .ds Aq '.\".\" If the F register is turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD.  Of course, you'll have to process the.\" output yourself in some meaningful fashion..ie \nF \{\.    de IX.    tm Index:\\$1\t\\n%\t"\\$2"...    nr % 0.    rr F.\}.el \{\.    de IX...\}.\".\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2)..\" Fear.  Run.  Save yourself.  No user-serviceable parts..    \" fudge factors for nroff and troff.if n \{\.    ds #H 0.    ds #V .8m.    ds #F .3m.    ds #[ \f1.    ds #] \fP.\}.if t \{\.    ds #H ((1u-(\\\\n(.fu%2u))*.13m).    ds #V .6m.    ds #F 0.    ds #[ \&.    ds #] \&.\}.    \" simple accents for nroff and troff.if n \{\.    ds ' \&.    ds ` \&.    ds ^ \&.    ds , \&.    ds ~ ~.    ds /.\}.if t \{\.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u".    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'.\}.    \" troff and (daisy-wheel) nroff accents.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'.ds 8 \h'\*(#H'\(*b\h'-\*(#H'.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#].ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#].ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#].ds ae a\h'-(\w'a'u*4/10)'e.ds Ae A\h'-(\w'A'u*4/10)'E.    \" corrections for vroff.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'.    \" for low resolution devices (crt and lpr).if \n(.H>23 .if \n(.V>19 \\{\.    ds : e.    ds 8 ss.    ds o a.    ds d- d\h'-1'\(ga.    ds D- D\h'-1'\(hy.    ds th \o'bp'.    ds Th \o'LP'.    ds ae ae.    ds Ae AE.\}.rm #[ #] #H #V #F C.\" ========================================================================.\".IX Title "File::Copy 3".TH File::Copy 3 "2007-12-18" "perl v5.10.0" "Perl Programmers Reference Guide".\" For nroff, turn off justification.  Always turn off hyphenation; it makes.\" way too many mistakes in technical documents..if n .ad l.nh.SH "NAME"File::Copy \- Copy files or filehandles.SH "SYNOPSIS".IX Header "SYNOPSIS".Vb 1\&        use File::Copy;\&\&        copy("file1","file2") or die "Copy failed: $!";\&        copy("Copy.pm",\e*STDOUT);\&        move("/dev1/fileA","/dev2/fileB");\&\&        use File::Copy "cp";\&\&        $n = FileHandle\->new("/a/file","r");\&        cp($n,"x");.Ve.SH "DESCRIPTION".IX Header "DESCRIPTION"The File::Copy module provides two basic functions, \f(CW\*(C`copy\*(C'\fR and\&\f(CW\*(C`move\*(C'\fR, which are useful for getting the contents of a file fromone place to another..IP "copy" 4.IX Xref "copy cp".IX Item "copy"The \f(CW\*(C`copy\*(C'\fR function takes twoparameters: a file to copy from and a file to copy to. Eitherargument may be a string, a FileHandle reference or a FileHandleglob. Obviously, if the first argument is a filehandle of somesort, it will be read from, and if it is a file \fIname\fR it willbe opened for reading. Likewise, the second argument will bewritten to (and created if need be).  Trying to copy a file on topof itself is a fatal error..Sp\&\fBNote that passing infiles as handles instead of names may lead to loss of informationon some operating systems; it is recommended that you use filenames whenever possible.\fR  Files are opened in binary mode whereapplicable.  To get a consistent behaviour when copying from afilehandle to a file, use \f(CW\*(C`binmode\*(C'\fR on the filehandle..SpAn optional third parameter can be used to specify the buffersize used for copying. This is the number of bytes from thefirst file, that will be held in memory at any given time, beforebeing written to the second file. The default buffer size dependsupon the file, but will generally be the whole file (up to 2MB), or1k for filehandles that do not reference files (eg. sockets)..SpYou may use the syntax \f(CW\*(C`use File::Copy "cp"\*(C'\fR to get at the\&\*(L"cp\*(R" alias for this function. The syntax is \fIexactly\fR the same..IP "move" 4.IX Xref "move mv rename".IX Item "move"The \f(CW\*(C`move\*(C'\fR function also takes two parameters: the current nameand the intended name of the file to be moved.  If the destinationalready exists and is a directory, and the source is not adirectory, then the source file will be renamed into the directoryspecified by the destination..SpIf possible, \fImove()\fR will simply rename the file.  Otherwise, it copiesthe file to the new location and deletes the original.  If an error occursduring this copy-and-delete process, you may be left with a (possibly partial)copy of the file under the destination name..SpYou may use the \*(L"mv\*(R" alias for this function in the same way thatyou may use the \*(L"cp\*(R" alias for \f(CW\*(C`copy\*(C'\fR..IP "syscopy" 4.IX Xref "syscopy".IX Item "syscopy"File::Copy also provides the \f(CW\*(C`syscopy\*(C'\fR routine, which copies thefile specified in the first parameter to the file specified in thesecond parameter, preserving OS-specific attributes and filestructure.  For Unix systems, this is equivalent to the simple\&\f(CW\*(C`copy\*(C'\fR routine, which doesn't preserve OS-specific attributes.  For\&\s-1VMS\s0 systems, this calls the \f(CW\*(C`rmscopy\*(C'\fR routine (see below).  For \s-1OS/2\s0systems, this calls the \f(CW\*(C`syscopy\*(C'\fR \s-1XSUB\s0 directly. For Win32 systems,this calls \f(CW\*(C`Win32::CopyFile\*(C'\fR..SpOn Mac \s-1OS\s0 (Classic), \f(CW\*(C`syscopy\*(C'\fR calls \f(CW\*(C`Mac::MoreFiles::FSpFileCopy\*(C'\fR,if available..Sp\&\fBSpecial behaviour if \f(CB\*(C`syscopy\*(C'\fB is defined (\s-1OS/2\s0, \s-1VMS\s0 and Win32)\fR:.SpIf both arguments to \f(CW\*(C`copy\*(C'\fR are not file handles,then \f(CW\*(C`copy\*(C'\fR will perform a \*(L"system copy\*(R" ofthe input file to a new output file, in order to preserve fileattributes, indexed file structure, \fIetc.\fR  The buffer sizeparameter is ignored.  If either argument to \f(CW\*(C`copy\*(C'\fR is ahandle to an opened file, then data is copied using Perloperators, and no effort is made to preserve file attributesor record structure..SpThe system copy routine may also be called directly under \s-1VMS\s0 and \s-1OS/2\s0as \f(CW\*(C`File::Copy::syscopy\*(C'\fR (or under \s-1VMS\s0 as \f(CW\*(C`File::Copy::rmscopy\*(C'\fR, whichis the routine that does the actual work for syscopy)..IP "rmscopy($from,$to[,$date_flag])" 4.IX Xref "rmscopy".IX Item "rmscopy($from,$to[,$date_flag])"The first and second arguments may be strings, typeglobs, typeglobreferences, or objects inheriting from IO::Handle;they are used in all cases to obtain the\&\fIfilespec\fR of the input and output files, respectively.  Thename and type of the input file are used as defaults for theoutput file, if necessary..SpA new version of the output file is always created, whichinherits the structure and \s-1RMS\s0 attributes of the input file,except for owner and protections (and possibly timestamps;see below).  All data from the input file is copied to theoutput file; if either of the first two parameters to \f(CW\*(C`rmscopy\*(C'\fRis a file handle, its position is unchanged.  (Note that thismeans a file handle pointing to the output file will beassociated with an old version of that file after \f(CW\*(C`rmscopy\*(C'\fRreturns, not the newly created version.).SpThe third parameter is an integer flag, which tells \f(CW\*(C`rmscopy\*(C'\fRhow to handle timestamps.  If it is < 0, none of the input file'stimestamps are propagated to the output file.  If it is > 0, thenit is interpreted as a bitmask: if bit 0 (the \s-1LSB\s0) is set, thentimestamps other than the revision date are propagated; if bit 1is set, the revision date is propagated.  If the third parameterto \f(CW\*(C`rmscopy\*(C'\fR is 0, then it behaves much like the \s-1DCL\s0 \s-1COPY\s0 command:if the name or type of the output file was explicitly specified,then no timestamps are propagated, but if they were taken implicitlyfrom the input filespec, then all timestamps other than therevision date are propagated.  If this parameter is not supplied,it defaults to 0..SpLike \f(CW\*(C`copy\*(C'\fR, \f(CW\*(C`rmscopy\*(C'\fR returns 1 on success.  If an error occurs,it sets \f(CW$!\fR, deletes the output file, and returns 0..SH "RETURN".IX Header "RETURN"All functions return 1 on success, 0 on failure.$! will be set if an error was encountered..SH "NOTES".IX Header "NOTES".IP "\(bu" 4On Mac \s-1OS\s0 (Classic), the path separator is ':', not '/', and the current directory is denoted as ':', not '.'. You should be careful about specifying relative pathnames. While a full path always begins with a volume name, a relative pathname should always begin with a \&':'.  If specifying a volume name only, a trailing ':' is required..SpE.g..Sp.Vb 8\&  copy("file1", "tmp");        # creates the file \*(Aqtmp\*(Aq in the current directory\&  copy("file1", ":tmp:");      # creates :tmp:file1\&  copy("file1", ":tmp");       # same as above\&  copy("file1", "tmp");        # same as above, if \*(Aqtmp\*(Aq is a directory (but don\*(Aqt do\&                               # that, since it may cause confusion, see example #1)\&  copy("file1", "tmp:file1");  # error, since \*(Aqtmp:\*(Aq is not a volume\&  copy("file1", ":tmp:file1"); # ok, partial path\&  copy("file1", "DataHD:");    # creates DataHD:file1\&\&  move("MacintoshHD:fileA", "DataHD:fileB"); # moves (doesn\*(Aqt copy) files from one\&                                             # volume to another.Ve.SH "AUTHOR".IX Header "AUTHOR"File::Copy was written by Aaron Sherman \fI<ajs@ajs.com>\fR in 1995,and updated by Charles Bailey \fI<bailey@newman.upenn.edu>\fR in 1996.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -