Re: Finding the newest directory

From: Sam Holden (sholden_at_flexal.cs.usyd.edu.au)
Date: 05/13/04


Date: 13 May 2004 03:04:26 GMT

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.

perldoc -f stat

-- 
Sam Holden


Relevant Pages

  • Re: Finding the newest directory
    ... >> Creation time is not tracked by the filesystem. ... >> You have access time, modification time, and ... File status time (ctime) is as close as ...
    (comp.lang.perl.misc)
  • Re: [SLE] cron not recognizing changes to /etc/cron.d files [SOLVED]
    ... I think that the stat example is better understandable if the stat command ... Linux function to set ctime; ... puma:tmp $ touch testfile ... Concerning the section "cron.daily drift": SUSE 9.2 and earlier had no ...
    (SuSE)
  • Re: [SLE] cron not recognizing changes to /etc/cron.d files [SOLVED]
    ... I think that the stat example is better understandable if the stat command is without the -c option. ... IMO the ls command with option -lc is more appropriate, and this obvious solution is missing on the page. ... There ain't no POSIX or Linux function to set ctime; ... puma:tmp $ touch testfile ...
    (SuSE)
  • Re: File + Date
    ... modification time, and access time. ... old C books, as they're all stored away, but a check of the header files ... Steve W. Jackson ...
    (comp.lang.java.programmer)
  • Re: [SLE] cron not recognizing changes to /etc/cron.d files [SOLVED] - OT
    ... timestamps that are being touched? ... there was no creation time maintained, but I also thought it was stated ... think) modification time. ... There is: stat. ...
    (SuSE)