Re: [ILUG] wierd "ls" behaviour...

From: Paul Kelly (longword at domain esatclear.ie)
Date: Thu 07 Jun 2001 - 20:45:20 IST


John P. Looney wrote:

> I'm downloading some files with "links", and when I use ls -l to get the
> status of the download;

>

> bartender [0] ls -lat sol-8-4_01-*
> -rw-r--r-- 1 john staff 39736536 Jun 7 2001 sol-8...
> -rw-r--r-- 1 john staff 34258488 Jun 7 13:57 sol-8...
> -rw-r--r-- 1 john staff 35909920 Jun 7 13:57 sol-8...
>
> Any idea why the date seems to flip between the time, and the year ?

I'll have a stab at this one.

When ls starts, it does a gettimeofday() and stores the returned
timestamp. Between that operation and running stat() on the files on
disk, the timestamp of the file has been updated by links - later than
the 'current' time cached by ls. Thus from the point of view of ls, the
file has a timestamp in the future, and this makes it display the year
instead of the time.

The above is not proven fact, merely a theory that fits the observation.
I leave the examination of the source up to your good self.

Paul.



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:10:36 GMT