我在将文件复制到基本上是 GlusterFS 安装共享的文件夹时遇到问题。
我的 Perl 脚本读取一个文件,进行一些解析,然后创建一个新文件。之后,我将新创建的具有不同名称的文件复制到不同的位置。
我收到这个错误
bin/cp: skipping file `/gfs_share/abc/xyz/aktar.txt', as it was replaced while being copied
我的 perl 代码:
foreach my $Id (@Studies){
my $Trigger_Start_1 = my $Trigger_End_1 = 0;
open(FILE,"$File_path") or die "In gen : Couldn't open file $File_path $! \n";
while(<FILE>){
chomp($_);
if($_ =~ /#INPUT_TYPE\s*(.*)/){
next;
}if($_ =~ /^ID\s+$Id/){
$Trigger_Start_1 = 1;
system ("echo 'Startstudy '>> $Input_FilePath/aktar.txt");
system ("echo '$_' >> $Input_FilePath/aktar.txt");
next;
}if(($Trigger_Start_1 == 2) && ($_ =~ /Endstudy/)){
$Trigger_End_1 = 0;
$Trigger_Start_1 = 0;
system ("echo '$_' >> $Input_FilePath/aktar.txt");
}
if($Trigger_Start_1 == 1){
if($_ =~/Disease\d*_run\d*/){
system ("echo '$_' >> $Input_FilePath/aktar.txt");
next;
}else{
system ("echo '$_' >> $Input_FilePath/aktar.txt");
}
$Trigger_Start_1 = 2;
next;
}
if(($Trigger_Start_1 == 2) && ($Trigger_End_1 == 0)){
system("echo '$_ ' >> $Input_FilePath/aktar.txt");
}
}
}
system ("echo 'Endvalidation '>> $Input_FilePath/aktar.txt");
close(FILE) or die "In gen : Unable to Close File $! \n";
`sed "s/#INPUT_TYPE $Input_Type//" input.txt > input1.txt`;
`sed "s/#DELTA_SET YES 5//" input1.txt > input.txt`;
`cat input.txt >> $Input_FilePath/aktar.txt`;
system ("echo 'INPUT : $Input_FilePath'>> $Input_FilePath/aktar.txt");
system("rm -rf $File_path") if(-e $File_path);
`/bin/cp $Source_Path/aktar.txt $To_Path`;