PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs323] -newer
Date: Sunday, 06 Sep 2020, 16:20:45


    > Message Posted By: Unknown
    >
    > When we use tv_sec, tv_nsec for -newer, does it take into account the
    > actual date the file was made? For example if we substract the tv_nsec of
    > file1 created on 9/4 at 8pm EST from a file2 created on 9/6 at 10am EST,
    > is file2.tv_nsec > file1.tv_nsec, or is the relative origin (start time)
    > of tv_nsec just the beginning of a particular day (12:00am)?

As stated in the specification

  This entry contains two fields:  tv_sec and tv_nsec, which are
  (respectively) the number of seconds since the start of Unix time, and
  the number of nanoseconds since the start of the current second.

Thus you must look first at tv_sec and, only if they are
equal, at tv_nsec to decided which file is older.

--Stan-
PREV INDEX NEXT