dkaplowitz has asked for the wisdom of the Perl Monks concerning the following question:
for the time stamp info. I've found snippets of code here and there to come up with this:my $file_date=localtime((stat("$file"))[9]);
but that's about as far as I've gotten, which feels like a long way from the desired result.#!/usr/bin/perl -w #!C:\Perl\bin\perl -w my $directory='/devl/bin'; my $size=0; my $file; my $file_date=localtime((stat("$file"))[9]); opendir(DIRHANDLE, $directory) or die "couldn't open $directory : $!\n +"; my@files = grep(!/^\.\.?$/,readdir(DIRHANDLE)); foreach $file (@files) { $size=(-s "$directory/$file"); print "$directory,$file,$size,$file_date"; print "\n"; } closedir(DIRHANDLE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: recursively compare folders in windows, synchronize the two folders with the newest files
by merlyn (Sage) on Mar 17, 2004 at 15:46 UTC | |
|
Re: recursively compare folders in windows, synchronize the two folders with the newest files
by matija (Priest) on Mar 17, 2004 at 16:14 UTC | |
|
Re: recursively compare folders in windows, synchronize the two folders with the newest files
by Abigail-II (Bishop) on Mar 17, 2004 at 16:33 UTC | |
by dkaplowitz (Novice) on Mar 23, 2004 at 15:09 UTC |