View Single Post
widebody911 widebody911 is offline
Too big to fail
 
widebody911's Avatar
 
Join Date: Jan 2002
Location: Carmichael, CA
Posts: 33,894
Garage
Send a message via AIM to widebody911 Send a message via Yahoo to widebody911
Use perl readdir structure to loop thru the files, for each file grab the fstat (File::stat) structure to get the timestamp, then copy the new file using a new index counter.

hacked-out psuedocode off the top of my head
Code:
use File::copy;
use File::stat;
use Time::locatime;

$new_index=1;
opendir(DIR, "your/data/directory") || die "ooops!"
foreach my $old_file (readdir(DIR)) {
   my $time = ctime(stat($old_file)->mtime);
  next if ($time outside my range) # you have to work out this bit
  
  copy ("$old_file", "file.$new_index)
   $new_index++;
}
close(dir);
__________________
"You go to the track with the Porsche you have, not the Porsche you wish you had."
'03 E46 M3
'57 356A
Various VWs
Old 08-18-2006, 10:37 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #4 (permalink)