Hi ,
I have axtrenal task which copies file from one WA folder to another WA folder,( This is for updating another WA files ).
I am using copy() command to achieve this. The command syntax is as below: ( This code is from my IPL script)
foreach my $file (
@files) {
$source_file_path = "Y:$iw_workarea\\$file";
$dest_file_path = "Y:$qa_dest\\$file";
# use iwupdate to copy file
write_log("copy: $source_file_path to $dest_file_path");
copy("$source_file_path", "$dest_file_path");
#move($source_file_path, $dest_file_path);
if ($!) {
my $errMessage = $!;
write_log("Error while copying");
write_log("Message : $errMessage");
}
}
****************************************
PROBLEM : When i copy files from a directory which is alreaday present in destination, the file gets updated. But when i have new file under WA/folder1/folder2/sample.html to be copied to dest WA where the file has to be copied over to same relative path , the IPL throws error as below:
---------------------------------
copy: Y:\mediastore1\main\media\global\media_wf\dev\WORKAREA\common\iw-web\hello\hello2.jsp to Y:\mediastore1\main\media\global\media_wf\prod\WORKAREA\qa\iw-web\hello\hello2.jsp
Error while copying
Message : No such file or directory
-------------------------------------
But same issue doesnt happen when i manually create the folder at destination. The files gets copied over.
I did try with move () as well but it didnt work.
I am working on TS 6.7.1 on Windows.
Do you have any suggestions for me to resolve this issue ?
Many Thanks.
Regards,
Praveen