Re: Finding the newest directory
From: Ben Morrow (usenet_at_morrow.me.uk)
Date: 05/13/04
- Next message: Matt Garrish: "Re: A Stupid question."
- Previous message: Bob Walton: "Re: Using hashes to sort number sequences"
- In reply to: Sam Holden: "Re: Finding the newest directory"
- Next in thread: Sam Holden: "Re: Finding the newest directory"
- Reply: Sam Holden: "Re: Finding the newest directory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 13 May 2004 03:09:51 +0000 (UTC)
Quoth sholden@cs.usyd.edu.au:
> On Wed, 12 May 2004 22:52:42 -0400, sc0ri0n <sc0ri0n@hotmail.com> wrote:
> > Hi,
> >
> > If I have a bunch of directories and files (sun solaris). Is there a way to
> > find the newest directory (last one created not modified)?
>
> No (unless you are using a funky non-standard file system).
>
> Creation time is not tracked by the filesystem.
>
> You have (most recent) access time, modification time, and
> file status time. File status time (ctime) is as close as
> you'll get, but it is set by other operations that change
> the file status (such as chmod(), link(), unlink(), etc.)
>
> stat gives you access to the ctime.
...and you'll likely want File::Find to do the searching.
OTOH, you could probably do this more easily with find(1).
Ben
-- For the last month, a large number of PSNs in the Arpa[Inter-]net have been reporting symptoms of congestion ... These reports have been accompanied by an increasing number of user complaints ... As of June,... the Arpanet contained 47 nodes and 63 links. [ftp://rtfm.mit.edu/pub/arpaprob.txt] * ben@morrow.me.uk
- Next message: Matt Garrish: "Re: A Stupid question."
- Previous message: Bob Walton: "Re: Using hashes to sort number sequences"
- In reply to: Sam Holden: "Re: Finding the newest directory"
- Next in thread: Sam Holden: "Re: Finding the newest directory"
- Reply: Sam Holden: "Re: Finding the newest directory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|