in reply to copy or ftp file by file timestamp
This will give the modified/created time of the file. If you are failing to browse thru the directory, then here's the code.scalar localtime((stat("$dir_name/$file"))[9]);
It'll browse thru directories/sub-directories as well.print_dir ( "YOUR/DIRECTORY/PATH" ); sub print_dir { my ($dir_name) = @_; opendir ( my $dir_h , "$dir_name") or die "Unable to open dir :$dir +_name: $!\n"; while ( my $file = readdir($dir_h) ) { next if ( "$dir_name/$file" =~ /\/\.$/ or "$dir_name/$file" =~ /\ +/\.\.$/ ); if ( -d "$dir_name/$file" ) { print_dir ( "$dir_name/$file" ); } print "$dir_name/$file - "."\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: copy or ftp file by file timestamp
by breezykatt (Acolyte) on Jul 23, 2009 at 18:13 UTC | |
by breezykatt (Acolyte) on Jul 24, 2009 at 13:31 UTC |