[EMAIL PROTECTED] wrote:
#!/usr/bin/perl -w
use strict;
#use diagnostics;
my $dir = "testdir";
opendir (DH, "$dir") || die "Could not open $dir: $!\n";
my @files; my $keep = 7;
while (defined(my $file = readdir(DH))){
next if $file =~ /^\.+$/;
push (@files, $file);
}
# Skip the rest if numb
#!/usr/bin/perl -w
use strict;
#use diagnostics;
my $dir = "testdir";
opendir (DH, "$dir") || die "Could not open $dir: $!\n";
my @files; my $keep = 7;
while (defined(my $file = readdir(DH))){
next if $file =~ /^\.+$/;
push (@files, $file);
}
# Skip the rest if number of files isn't abo
Babale Fongo wrote:
It was just an attempt to see how someone else may tackle this issue. I
thought of sorting, but I wasn't sure it will do exactly what I expect.
Here is what I've have so far:
my $dir = "/mydir";
opendir(DH, "$dir") || die "Failed to open $dir: $!\n";
my $counter = 0;
while (def
Please bottom post
Babale Fongo wrote:
It was just an attempt to see how someone else may tackle this issue. I
thought of sorting, but I wasn't sure it will do exactly what I expect.
Here is what I've have so far:
my $dir = "/mydir";
opendir(DH, "$dir") || die "Failed to open $dir: $!\n";
my $
sage-
||From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED]
||Sent: Saturday, February 12, 2005 5:19 PM
||To: [EMAIL PROTECTED]
||Cc: beginners@perl.org
||Subject: Re: Compare file modification time
||
||[EMAIL PROTECTED] wrote:
||> How do I best compare mtime of several files. I have
[EMAIL PROTECTED] wrote:
How do I best compare mtime of several files. I have a script for making
daily backups into a given directory. Now I want to modify it to
delete old backups if the total exceed cetain number.
The idea was to compare the mtime of all file to figure out old files to
delete
How do I best compare mtime of several files. I have a script for making
daily backups into a given directory. Now I want to modify it to
delete old backups if the total exceed cetain number.
The idea was to compare the mtime of all file to figure out old files to
delete, but somehow I think it