A
AJ
I am trying to build a script to move files between a couple of FTP
servers and I need to rename the files before I transfer them to the
second server. I am able to get them to a network directory without any
problems but I am having trouble manipulating the files once there.
Below is the code snipit I am having trouble with. Anyone have some
insight?
while ($nextname = <\\\\serverName\\shareName\\PTL\\PTL*.txt>) {
#strip off .txt extension store for uses after file has been ftped
(for second rename)
print $nextname "\n";
$basename = $nextname;
print $basename " ->";
$basename =~ s#.*/##;
print $basename " ->";
$dnlname = $basename.".dnl";
print $dnlname "\n";
if ($PickFTP->Put($nextname.dnl)){
if ($PickFTP->Rename($nextname.dnl,$nextname)) {
print LOGfile "$thisDay, $thisMonth $mday, $Year, $hour:$min:$sec -
Transfer of $nextname.txt to PTL server sucessful.\n";
}
}
}
Thanks for your responses.
--AJ
servers and I need to rename the files before I transfer them to the
second server. I am able to get them to a network directory without any
problems but I am having trouble manipulating the files once there.
Below is the code snipit I am having trouble with. Anyone have some
insight?
while ($nextname = <\\\\serverName\\shareName\\PTL\\PTL*.txt>) {
#strip off .txt extension store for uses after file has been ftped
(for second rename)
print $nextname "\n";
$basename = $nextname;
print $basename " ->";
$basename =~ s#.*/##;
print $basename " ->";
$dnlname = $basename.".dnl";
print $dnlname "\n";
if ($PickFTP->Put($nextname.dnl)){
if ($PickFTP->Rename($nextname.dnl,$nextname)) {
print LOGfile "$thisDay, $thisMonth $mday, $Year, $hour:$min:$sec -
Transfer of $nextname.txt to PTL server sucessful.\n";
}
}
}
Thanks for your responses.
--AJ