| 查看: 1044 | 回复: 0 | ||
[求助]
perl里的File::Copy模块求助
|
|
我写了一段程序 ,意思是,/home/liya/APOLLO/models下查找名称与$protein_dir一致的目录; 找到后,把该目录下名称与$model_name一致的pdb文件复制到指定目录$targetdir下。 终端提示的错误是 copy failed:是一个目录 at /home/liya/APOLLO/extract_wrong.pl line 29. 这是为什么呀???为这个折腾两天了也没搞定啊! opendir DIR,"/home/liya/APOLLO/models" or die "cannot open model_dir:$!"; foreach my $file(readdir DIR){ next if $file ~~ $protein_dir; if (-d $file){ opendir SUBDIR,$file or die "cannot open $protein_dir:$!"; foreach my $subfile (readdir SUBDIR){ 26 next if $subfile ~~ $model_name; 27 if (-e $subfile){ 28 chdir "/home/liya/AOPLLO/models/$file"; 29 copy ($subfile,$targetdir."/".$subfile) or die "copy failed:$!"; 30 } } close SUBDIR; } } close DIR; |
» 猜你喜欢
征友后感触
已经有10人回复
考博求助
已经有4人回复
憎水剂,表面活性剂
已经有3人回复
申博
已经有7人回复
食品与机械 编辑C处理稿子时间
已经有4人回复
注意啦!用基金购买打印纸、硒鼓、优盘、移动硬盘、个人计算机属于违规了
已经有4人回复










回复此楼