#!/usr/bin/perl
use File::Copy;
use File::Copy::Recursive;
$old_folder=$ARGV[0];
$new_folder=$ARGV[1];
$folder_loc=$ARGV[2];
print "Content-type:folder rename\n\n";
#rename($arg1,$arg2) || print "Don't have permission to rename.<br><br>";
File::Copy::Recursive::dircopy("$folder_loc/$old_folder","$folder_loc/$new_folder");
print "Renaming Done!";
exit;
这里我的旧文件夹也存在于文件夹rename后我可以在重命名后删除旧文件夹。请帮助我
答案 0 :(得分:5)
我认为您要使用File::Copy::Recursive::dirmove
代替dircopy
答案 1 :(得分:0)
您可以使用File::Path删除整个目录树(包括文件)。