Re: reading a directory, first files the newest ones
- From: Mark Clements <mark.clementsREMOVETHIS@xxxxxxxxxx>
- Date: Sun, 28 Oct 2007 17:58:46 +0100
jordilin wrote:
When I read a huge directory with opendir,Maybe you could do something with File::Monitor, although I know nothing of its efficiency with large directories. FAM may also be worth a look.
opendir(DIR,"dirname");
my $file;
while($file=readdir(DIR))
whatever...
it loads the oldest ones first. I would like the newest files first,
instead of the oldest. Taking into account that I am only interested
in the newest files, this takes a lot of time, as the directory is
really huge. I am talking about thousands and thousands of files. I
need to process the files that are two hours old from now. I am not
interested in those older than two hours ago. I know that because I
check the modification time with stat.
any idea?
Thanks in advance
Mark
.
- References:
- reading a directory, first files the newest ones
- From: jordilin
- reading a directory, first files the newest ones
- Prev by Date: Re: packing a C structure
- Next by Date: Re: how to redirect error to variable
- Previous by thread: Re: reading a directory, first files the newest ones
- Next by thread: FAQ 8.35 How do I close a process's filehandle without waiting for it to complete?
- Index(es):
Relevant Pages
|