[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] finding last created files in a directory



On Wed, Jul 21, 1999 at 02:21:28PM -0400, Stephane Jose wrote:
> Hi,
>  
> I would like to be able to read in a variable the
> names of the five last created files in a given
> directory containing hundreds of files, based on
> the files creation dates.
>  
> What would be the most efficient strategy? Is
> there a way to avoid to stat all the files?
>  

Well, you can't know when a file was created without checking the creation
date.  On the other hand, you could keep a permanent index of files and
creation dates, so that you only have to stat each file once.  I don't know
whether that would be more efficient.

Ronald


===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org