Hi,
My requirement is to copy a file into two different directories and rename them with the following.
1. filename.txt to be moved from inbox directory to archive directory and filename to be renamed to filename.<dateTime>.txt
I tried to do this by using use Time::Piece; and use File::Copy;
Got dateTime by using "my $toDate = localtime->strftime('%F %T');"
Got archive file name by using "my $archiveFileName = $newArchive."_".$toDate.".txt";"
but when I try to use copy to copy the file to archive directory it wont work.
I am using "copy ($filename, archive\\$archiveFileName);" in code.
2. filename.txt to be moved from inbox directory to out directory and filename to be renamed to filenameout.txt
I was able to do this by using rename.
Can anyone suggest how can we achieve this functionality.
Regards,
Raj
In reply to copy isn't working by YellowJackets
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |