Results 1 to 3 of 3
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 ...
- 02-06-2008 #1Just Joined!
- Join Date
- Jul 2006
- Posts
- 3
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
- 02-07-2008 #2
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:
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:Code:time_t st_atime; /* time of last access */
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.Code:time_t Used for time in seconds.
But hopefully this helps you understand what's going on.DISTRO=Arch
Registered Linux User #388732
- 02-07-2008 #3Just Joined!
- Join Date
- Jul 2006
- Posts
- 3
That's exactly what I needed to know. Thanks a bunch.


Reply With Quote
