【发布时间】:2014-05-03 06:00:34
【问题描述】:
当我使用 fcopy 将文件从 UNC 路径复制到另一个路径时,如果目标目录不存在,它就不起作用。但它确实在本地路径上完美运行,(导致创建该目录)
use File::Copy::Recursive qw(fcopy rcopy dircopy fmove rmove dirmove);
use autodie qw'fcopy rmove';
#works. Folder is created, File is copied.
fcopy ("/path/to/file", "/path/to/non/existing/path");
#works too. No need to create a folder.
fcopy ("//path/to/UNC/Share/File", "//path/to/existing/Share");
#doesn't work.
fcopy ("path/to/UNC/Share/File", ""//path/to/existing/Share/with/non/existing/folder");
它随着
而死下面的例子
my $file1 = "//server/existing/file"
if (! -f $file1 ) {
print "$file1 does not exist";
exit 2;
}
fcopy($file1, "//server/targetDirectory/newFolder"
死于
can't fcopy('//server/existing/file', '//server/targetDirectory/newFolder'): No such file or d
test.pl 第 20 行的目录
是否无法使用 UNC 路径在 samba 共享上使用 rcopy 创建目录,或者这是一个错误吗?
【问题讨论】:
标签: perl recursion copy directory unc