Win32: File Manipulation
- From: "AJ" <aragorn.m@xxxxxxxxx>
- Date: 3 Jul 2006 16:26:21 -0700
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
.
- Follow-Ups:
- Re: Win32: File Manipulation
- From: Bart Lateur
- Re: Win32: File Manipulation
- From: Paul Lalli
- Re: Win32: File Manipulation
- From: jue
- Re: Win32: File Manipulation
- Prev by Date: Re: Book exists?: "Definitive Guide to Object-Oriented Programming in Perl"
- Next by Date: Which is the perl questions ng for beginners
- Previous by thread: Book exists?: "Definitive Guide to Object-Oriented Programming in Perl"
- Next by thread: Re: Win32: File Manipulation
- Index(es):
Relevant Pages
|
|