Re: Handling OLD files

2008-03-28 Thread Sandy
On Mar 27, 1:40 pm, [EMAIL PROTECTED] (Anders) wrote: I am looking for a way of moving files older than a date, I am need this in a script for moving/erase old files from a production machine Try using File::Find http://search.cpan.org/~nwclark/perl-5.8.7/lib/File/Find.pm /sandy

Re: Handling OLD files

2008-03-28 Thread Ben Bullock
On Mar 28, 5:40 am, [EMAIL PROTECTED] (Anders) wrote: Hi! I am looking for a way of moving files older than a date, You can find the number of days since a file was last modified with - M: #! perl use warnings; use strict; opendir (my $dir, .) or die $1; for (readdir ($dir)) { print $_, is

Re: Handling OLD files

2008-03-28 Thread Robert (bloo)
Sandy wrote: On Mar 27, 1:40 pm, [EMAIL PROTECTED] (Anders) wrote: I am looking for a way of moving files older than a date, I am need this in a script for moving/erase old files from a production machine Try using File::Find http://search.cpan.org/~nwclark/perl-5.8.7/lib/File/Find.pm

Re: Handling OLD files

2008-03-28 Thread Santosh Patil`
below peace of code u list of files, sorted according the date @lfiles = grep {stat($_)-mtime() $date} @files; On Fri, Mar 28, 2008 at 5:08 PM, Robert (bloo) [EMAIL PROTECTED] wrote: Sandy wrote: On Mar 27, 1:40 pm, [EMAIL PROTECTED]

Re: Handling OLD files

2008-03-28 Thread anders
Thanks everyone for the help mvh Anders -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Handling OLD files

2008-03-27 Thread anders
Hi! I am looking for a way of moving files older than a date, I am need this in a script for moving/erase old files from a production machine Any tips where to read more about this i gratefull, i can't find any, (it is on a Windows server) and i would like to stick to PERL standard package

Re: Handling OLD files

2008-03-27 Thread yitzle
To get the date of a file: perldoc stat http://perldoc.perl.org/functions/stat.html For moving files: http://perldoc.perl.org/perlfaq5.html#How-can-I-reliably-rename-a-file%3f -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/