in reply to Preserving timestamps with Net::FTP
Regards,#get the modification time of the remote file #assuming $ftp is a Net::FTP object my $mtime = $ftp->mdtm($file); #download the file $ftp->get($file); #set the time of the local file # (assumes $file is also the local file name) utime $mtime, $mtime, $file;
my $now = time; utime $now, $now, @localfiles;
Update #2: Another solution (also a kludge but it would work) would be to keep a logfile for each machine with the filenames and times. Then you could just parse the logfile and compare to your local files to see what needs to be uploaded.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Preserving timestamps with Net::FTP
by IraTarball (Monk) on Jun 25, 2001 at 23:52 UTC |