?? copy.cgi
字號:
#!/usr/local/bin/perl# copy.cgi# Copy some file or directoryrequire './file-lib.pl';&ReadParse();&switch_acl_uid();print "Content-type: text/plain\n\n";if (!&can_access($in{'from'})) { print &text('copy_efrom', $in{'from'}),"\n"; exit; }if (!&can_access($in{'to'})) { print &text('copy_eto', $in{'to'}),"\n"; exit; }if (-l $in{'from'}) { # Remake the link if (!symlink(readlink($in{'from'}), $in{'to'})) { print &text('copy_elink', $!),"\n"; exit; } }elsif (-d $in{'from'}) { # Recursively copy with tar ($fromdir, $fromfile) = &split_dir($in{'from'}); ($todir, $tofile) = &split_dir($in{'to'}); unlink($in{'to'}); $out = `(cd "$fromdir"; tar cf - "$fromfile" | (cd "$todir"; tar xf -)) 2>&1`; }else { # Simple copy using cp unlink($in{'to'}); $out = `cp -p "$in{'from'}" "$in{'to'}" 2>&1`; }if ($?) { print $out,"\n"; }else { print "\n"; print &file_info_line($in{'to'}),"\n"; }sub split_dir{$_[0] =~ /^(.*\/)([^\/]+)$/;return ($1, $2);}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -