亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? copy.pm

?? ARM上的如果你對底層感興趣
?? PM
字號:
# File/Copy.pm. Written in 1994 by Aaron Sherman <ajs@ajs.com>. This
# source code has been placed in the public domain by the author.
# Please be kind and preserve the documentation.
#
# Additions copyright 1996 by Charles Bailey.  Permission is granted
# to distribute the revised code under the same terms as Perl itself.

package File::Copy;

use strict;
use Carp;
use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION $Too_Big
	    &copy &syscopy &cp &mv);

# Note that this module implements only *part* of the API defined by
# the File/Copy.pm module of the File-Tools-2.0 package.  However, that
# package has not yet been updated to work with Perl 5.004, and so it
# would be a Bad Thing for the CPAN module to grab it and replace this
# module.  Therefore, we set this module's version higher than 2.0.
$VERSION = '2.02';

require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(copy move);
@EXPORT_OK = qw(cp mv);

$Too_Big = 1024 * 1024 * 2;

sub _catname { #  Will be replaced by File::Spec when it arrives
    my($from, $to) = @_;
    if (not defined &basename) {
	require File::Basename;
	import  File::Basename 'basename';
    }
    if ($^O eq 'VMS')  { $to = VMS::Filespec::vmspath($to) . basename($from); }
    elsif ($^O eq 'MacOS') { $to .= ':' . basename($from); }
    elsif ($to =~ m|\\|)   { $to .= '\\' . basename($from); }
    else                   { $to .= '/' . basename($from); }
}

sub copy {
    croak("Usage: copy(FROM, TO [, BUFFERSIZE]) ")
      unless(@_ == 2 || @_ == 3);

    my $from = shift;
    my $to = shift;

    my $from_a_handle = (ref($from)
			 ? (ref($from) eq 'GLOB'
			    || UNIVERSAL::isa($from, 'GLOB')
                            || UNIVERSAL::isa($from, 'IO::Handle'))
			 : (ref(\$from) eq 'GLOB'));
    my $to_a_handle =   (ref($to)
			 ? (ref($to) eq 'GLOB'
			    || UNIVERSAL::isa($to, 'GLOB')
                            || UNIVERSAL::isa($to, 'IO::Handle'))
			 : (ref(\$to) eq 'GLOB'));

    if (!$from_a_handle && !$to_a_handle && -d $to && ! -d $from) {
	$to = _catname($from, $to);
    }

    if (defined &syscopy && \&syscopy != \&copy
	&& !$to_a_handle
	&& !($from_a_handle && $^O eq 'os2' )	# OS/2 cannot handle handles
	&& !($from_a_handle && $^O eq 'mpeix')	# and neither can MPE/iX.
       )	
    {
	return syscopy($from, $to);
    }

    my $closefrom = 0;
    my $closeto = 0;
    my ($size, $status, $r, $buf);
    local(*FROM, *TO);
    local($\) = '';

    if ($from_a_handle) {
	*FROM = *$from{FILEHANDLE};
    } else {
	$from = "./$from" if $from =~ /^\s/;
	open(FROM, "< $from\0") or goto fail_open1;
	binmode FROM or die "($!,$^E)";
	$closefrom = 1;
    } 
 
    if ($to_a_handle) {
	*TO = *$to{FILEHANDLE};
    } else {        
	$to = "./$to" if $to =~ /^\s/;
	open(TO,"> $to\0") or goto fail_open2;
	binmode TO or die "($!,$^E)";
	$closeto = 1;
    }  

    if (@_) {
	$size = shift(@_) + 0;
	croak("Bad buffer size for copy: $size\n") unless ($size > 0);
    } else {
	$size = -s FROM;
	$size = 1024 if ($size < 512);
	$size = $Too_Big if ($size > $Too_Big);
    }

    $! = 0;
    for (;;) {
	my ($r, $w, $t);
	defined($r = sysread(FROM, $buf, $size))
	    or goto fail_inner;
	last unless $r;
	for ($w = 0; $w < $r; $w += $t) {
	    $t = syswrite(TO, $buf, $r - $w, $w)
		or goto fail_inner;
	}
    }

    close(TO) || goto fail_open2 if $closeto;
    close(FROM) || goto fail_open1 if $closefrom;

    # Use this idiom to avoid uninitialized value warning.
    return 1;
    
    # All of these contortions try to preserve error messages...
  fail_inner:
    if ($closeto) {
	$status = $!;
	$! = 0;
	close TO;
	$! = $status unless $!;
    }
  fail_open2:
    if ($closefrom) {
	$status = $!;
	$! = 0;
	close FROM;
	$! = $status unless $!;
    }
  fail_open1:
    return 0;
}

sub move {
    my($from,$to) = @_;
    my($copied,$fromsz,$tosz1,$tomt1,$tosz2,$tomt2,$sts,$ossts);

    if (-d $to && ! -d $from) {
	$to = _catname($from, $to);
    }

    ($tosz1,$tomt1) = (stat($to))[7,9];
    $fromsz = -s $from;
    if ($^O eq 'os2' and defined $tosz1 and defined $fromsz) {
      # will not rename with overwrite
      unlink $to;
    }
    return 1 if rename $from, $to;

    ($sts,$ossts) = ($! + 0, $^E + 0);
    # Did rename return an error even though it succeeded, because $to
    # is on a remote NFS file system, and NFS lost the server's ack?
    return 1 if defined($fromsz) && !-e $from &&           # $from disappeared
                (($tosz2,$tomt2) = (stat($to))[7,9]) &&    # $to's there
                ($tosz1 != $tosz2 or $tomt1 != $tomt2) &&  #   and changed
                $tosz2 == $fromsz;                         # it's all there
 
    ($tosz1,$tomt1) = (stat($to))[7,9];  # just in case rename did something
    return 1 if ($copied = copy($from,$to)) && unlink($from);
  
    ($tosz2,$tomt2) = ((stat($to))[7,9],0,0) if defined $tomt1;
    unlink($to) if !defined($tomt1) or $tomt1 != $tomt2 or $tosz1 != $tosz2;
    ($!,$^E) = ($sts,$ossts);
    return 0;
}

*cp = \&copy;
*mv = \&move;

# &syscopy is an XSUB under OS/2
unless (defined &syscopy) {
    if ($^O eq 'VMS') {
	*syscopy = \&rmscopy;
    } elsif ($^O eq 'mpeix') {
	*syscopy = sub {
	    return 0 unless @_ == 2;
	    # Use the MPE cp program in order to
	    # preserve MPE file attributes.
	    return system('/bin/cp', '-f', $_[0], $_[1]) == 0;
	};
    } else {
	*syscopy = \&copy;
    }
}

1;

__END__

=head1 NAME

File::Copy - Copy files or filehandles

=head1 SYNOPSIS

  	use File::Copy;

	copy("file1","file2");
  	copy("Copy.pm",\*STDOUT);'
	move("/dev1/fileA","/dev2/fileB");

  	use POSIX;
	use File::Copy cp;

	$n=FileHandle->new("/dev/null","r");
	cp($n,"x");'

=head1 DESCRIPTION

The File::Copy module provides two basic functions, C<copy> and
C<move>, which are useful for getting the contents of a file from
one place to another.

=over 4

=item *

The C<copy> function takes two
parameters: a file to copy from and a file to copy to. Either
argument may be a string, a FileHandle reference or a FileHandle
glob. Obviously, if the first argument is a filehandle of some
sort, it will be read from, and if it is a file I<name> it will
be opened for reading. Likewise, the second argument will be
written to (and created if need be).

B<Note that passing in
files as handles instead of names may lead to loss of information
on some operating systems; it is recommended that you use file
names whenever possible.>  Files are opened in binary mode where
applicable.  To get a consistent behavour when copying from a
filehandle to a file, use C<binmode> on the filehandle.

An optional third parameter can be used to specify the buffer
size used for copying. This is the number of bytes from the
first file, that wil be held in memory at any given time, before
being written to the second file. The default buffer size depends
upon the file, but will generally be the whole file (up to 2Mb), or
1k for filehandles that do not reference files (eg. sockets).

You may use the syntax C<use File::Copy "cp"> to get at the
"cp" alias for this function. The syntax is I<exactly> the same.

=item *

The C<move> function also takes two parameters: the current name
and the intended name of the file to be moved.  If the destination
already exists and is a directory, and the source is not a
directory, then the source file will be renamed into the directory
specified by the destination.

If possible, move() will simply rename the file.  Otherwise, it copies
the file to the new location and deletes the original.  If an error occurs
during this copy-and-delete process, you may be left with a (possibly partial)
copy of the file under the destination name.

You may use the "mv" alias for this function in the same way that
you may use the "cp" alias for C<copy>.

=back

File::Copy also provides the C<syscopy> routine, which copies the
file specified in the first parameter to the file specified in the
second parameter, preserving OS-specific attributes and file
structure.  For Unix systems, this is equivalent to the simple
C<copy> routine.  For VMS systems, this calls the C<rmscopy>
routine (see below).  For OS/2 systems, this calls the C<syscopy>
XSUB directly.

=head2 Special behavior if C<syscopy> is defined (VMS and OS/2)

If both arguments to C<copy> are not file handles,
then C<copy> will perform a "system copy" of
the input file to a new output file, in order to preserve file
attributes, indexed file structure, I<etc.>  The buffer size
parameter is ignored.  If either argument to C<copy> is a
handle to an opened file, then data is copied using Perl
operators, and no effort is made to preserve file attributes
or record structure.

The system copy routine may also be called directly under VMS and OS/2
as C<File::Copy::syscopy> (or under VMS as C<File::Copy::rmscopy>, which
is the routine that does the actual work for syscopy).

=over 4

=item rmscopy($from,$to[,$date_flag])

The first and second arguments may be strings, typeglobs, typeglob
references, or objects inheriting from IO::Handle;
they are used in all cases to obtain the
I<filespec> of the input and output files, respectively.  The
name and type of the input file are used as defaults for the
output file, if necessary.

A new version of the output file is always created, which
inherits the structure and RMS attributes of the input file,
except for owner and protections (and possibly timestamps;
see below).  All data from the input file is copied to the
output file; if either of the first two parameters to C<rmscopy>
is a file handle, its position is unchanged.  (Note that this
means a file handle pointing to the output file will be
associated with an old version of that file after C<rmscopy>
returns, not the newly created version.)

The third parameter is an integer flag, which tells C<rmscopy>
how to handle timestamps.  If it is E<lt> 0, none of the input file's
timestamps are propagated to the output file.  If it is E<gt> 0, then
it is interpreted as a bitmask: if bit 0 (the LSB) is set, then
timestamps other than the revision date are propagated; if bit 1
is set, the revision date is propagated.  If the third parameter
to C<rmscopy> is 0, then it behaves much like the DCL COPY command:
if the name or type of the output file was explicitly specified,
then no timestamps are propagated, but if they were taken implicitly
from the input filespec, then all timestamps other than the
revision date are propagated.  If this parameter is not supplied,
it defaults to 0.

Like C<copy>, C<rmscopy> returns 1 on success.  If an error occurs,
it sets C<$!>, deletes the output file, and returns 0.

=back

=head1 RETURN

All functions return 1 on success, 0 on failure.
$! will be set if an error was encountered.

=head1 AUTHOR

File::Copy was written by Aaron Sherman I<E<lt>ajs@ajs.comE<gt>> in 1995,
and updated by Charles Bailey I<E<lt>bailey@genetics.upenn.eduE<gt>> in 1996.

=cut

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜视频一区在线观看| 91亚洲国产成人精品一区二三| 欧美不卡视频一区| 国产成a人亚洲| 久久一区二区视频| 成人高清视频在线| 中文字幕av一区二区三区免费看| 国产不卡在线视频| 亚洲视频一二三区| 51精品秘密在线观看| 国产美女av一区二区三区| 亚洲精品在线网站| 亚洲午夜一区二区| 99久久国产综合精品女不卡| 欧美一区二区三区视频免费播放 | 在线观看精品一区| 久久亚洲一区二区三区四区| 日韩成人一区二区三区在线观看| 91成人免费在线视频| 日韩一区有码在线| 成人精品鲁一区一区二区| 精品福利一区二区三区| 天堂av在线一区| 欧美蜜桃一区二区三区| 亚洲成在人线免费| 欧美色电影在线| 一区二区三区毛片| 色94色欧美sute亚洲线路一ni| 中文字幕一区二区三区在线播放| 成人毛片视频在线观看| 久久精品综合网| 国产成人av电影免费在线观看| 精品日韩在线一区| 久久超级碰视频| 91精品国产综合久久国产大片 | 国产精品不卡在线| 懂色av一区二区三区免费观看| 26uuu欧美日本| 国产成人午夜精品5599 | 国产成人精品网址| 中文字幕精品三区| 99精品欧美一区二区三区综合在线| 久久久久国产精品人| 国产福利一区二区三区| 久久婷婷国产综合国色天香 | 久久精品视频在线看| 懂色中文一区二区在线播放| 国产精品久久99| 在线观看国产91| 福利一区二区在线观看| 麻豆精品一区二区av白丝在线| 一本一道波多野结衣一区二区| 欧美精品第1页| 中文字幕一区三区| 五月婷婷激情综合网| 日本不卡一二三区黄网| 国产一区二区精品在线观看| 成人免费毛片片v| 欧美日韩一级黄| 久久综合久久综合久久| 免费在线观看视频一区| 国产亚洲一区二区三区四区| 成人午夜在线免费| 一区二区免费在线播放| 欧美一级国产精品| voyeur盗摄精品| 日韩在线一区二区| 日本一区二区综合亚洲| 欧美三级一区二区| 国产九色sp调教91| 亚洲人成网站影音先锋播放| 欧美日本在线看| 成人丝袜高跟foot| 青青青爽久久午夜综合久久午夜 | 成人精品视频一区二区三区尤物| 亚洲综合色在线| 欧美精品一区二区三区蜜臀| 日本高清成人免费播放| 国产在线播放一区三区四| 国产精品羞羞答答xxdd| 亚洲另类色综合网站| 精品国产成人系列| 91久久人澡人人添人人爽欧美| 久久精品国产一区二区| 亚洲一区二区av电影| 国产亚洲精品精华液| 91精品国产综合久久精品图片| 不卡av在线网| 狠狠色狠狠色综合日日91app| 亚洲综合免费观看高清完整版在线 | 中文字幕亚洲精品在线观看| 欧美一区二区私人影院日本| 91丨porny丨国产入口| 国产一区美女在线| 日本不卡的三区四区五区| 中文无字幕一区二区三区| 日韩欧美另类在线| 欧美亚洲高清一区| 色婷婷国产精品| 91网站在线观看视频| 成人一区二区三区| 国产成人在线观看| 国产在线不卡一区| 紧缚奴在线一区二区三区| 国内精品国产三级国产a久久| 久久久精品中文字幕麻豆发布| 国产精品麻豆网站| 88在线观看91蜜桃国自产| 国产麻豆91精品| 亚洲成va人在线观看| 久久久久久免费网| 色悠久久久久综合欧美99| 久久激情五月激情| 亚洲国产视频直播| 欧美极品aⅴ影院| 欧美精品在线一区二区三区| 99久久国产综合精品色伊| 久久女同互慰一区二区三区| 日韩精品资源二区在线| 日韩一二在线观看| 欧美成人一区二区三区片免费 | 国产一区91精品张津瑜| 久久99热这里只有精品| 久久99精品久久久久久国产越南| 日本中文在线一区| 精品影视av免费| 国产成人欧美日韩在线电影| 国产精品99久久久久久似苏梦涵 | 亚洲国产成人一区二区三区| 久久综合久色欧美综合狠狠| 久久久噜噜噜久噜久久综合| 国产精品美女久久福利网站| 中文字幕av一区 二区| 亚洲视频1区2区| 亚洲一区二区五区| 石原莉奈一区二区三区在线观看| 蜜臀av亚洲一区中文字幕| 国产精品一线二线三线精华| 99re视频精品| 欧美伦理视频网站| 久久人人爽人人爽| 亚洲少妇最新在线视频| 午夜日韩在线电影| 国内精品伊人久久久久av一坑| 99这里只有精品| 欧美乱妇15p| 国产亚洲精品aa| 亚洲主播在线播放| 久久国产剧场电影| 91丨九色丨蝌蚪丨老版| 欧美精品视频www在线观看| 精品久久久久久久久久久久久久久| 久久久美女艺术照精彩视频福利播放| 亚洲视频狠狠干| 久久er精品视频| 欧美优质美女网站| 久久久无码精品亚洲日韩按摩| 亚洲欧美视频在线观看视频| 日本中文字幕一区二区有限公司| 成人午夜碰碰视频| 欧美精品久久99| 综合网在线视频| 韩国三级在线一区| 欧美在线三级电影| 国产日韩欧美高清| 男人的天堂亚洲一区| 日本韩国精品在线| 国产午夜精品福利| 日韩成人免费在线| 一本到不卡免费一区二区| 久久―日本道色综合久久| 天天综合天天综合色| www.亚洲在线| 26uuu精品一区二区在线观看| 亚洲综合一二区| 成人av在线资源网| 久久综合丝袜日本网| 日韩影院在线观看| 91成人免费在线| 中文字幕一区二区三区四区不卡| 激情五月婷婷综合| 欧美一区二区三区小说| 亚洲综合一区二区三区| 97久久超碰国产精品电影| 国产亚洲美州欧州综合国| 精品在线观看视频| 日韩精品自拍偷拍| 欧美aaa在线| 日韩欧美国产系列| 日本视频一区二区三区| 欧美色图激情小说| 一区二区三区成人| 欧洲日韩一区二区三区| 亚洲一级片在线观看| 色哟哟国产精品| 亚洲中国最大av网站| 欧美日韩一区国产| 亚洲国产精品一区二区久久恐怖片| 色综合天天做天天爱| 亚洲视频狠狠干|