Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    File access/modification time precision

    How can I increase the precision of the filesystem access and modification times? Basically, I want the zeros:

    pvr.rdc.lan:/tmp 189$ls -al --time-style=full-iso yum.list
    -rw-r--r-- 1 root root 165770 2008-02-06 10:09:18.000000000 -0800 yum.list

    after 10:09:18 to be real and meaningful. Or is one second the greatest precision we've got?

    /apologies if this is in the wrong forum

  2. #2
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Seattle, WA, USA
    I don't know the answer for sure. But here is what I believe is happening:

    ls uses the stat() system call to figure out information about a file. From the stat(2) man page:
    time_t    st_atime;   /* time of last access */
    So the last access time of a file is returned as a value of type time_t. What is time_t? From the types.h(OP) man page:
    time_t Used for time in seconds.
    So if I am correct, then the problem is that ls is told the time only as precise as seconds. And I am not sure how to get around this.

    But hopefully this helps you understand what's going on.

  3. #3
    That's exactly what I needed to know. Thanks a bunch.

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts