Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Misc
Reload this Page File access/modification time precision
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Misc Any questions or Linux discussion that does not fit in any of the other technical areas.

Reply
 
Thread Tools Display Modes
Old 02-06-2008   #1 (permalink)
RocketRay
Just 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
RocketRay is offline   Reply With Quote
Old 02-07-2008   #2 (permalink)
Cabhan
Linux Guru
 
Cabhan's Avatar
 
Join Date: Jan 2005
Location: Seattle, WA, USA
Posts: 2,401
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:
Code:
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:
Code:
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.
__________________
DISTRO=Gentoo
Registered Linux User #388732
Gentoo Linux, 410 GB HD, 1.2 GB RAM, Fluxbox, These are a Few of my Favorite Things
Cabhan is offline   Reply With Quote
Old 02-07-2008   #3 (permalink)
RocketRay
Just Joined!
 
Join Date: Jul 2006
Posts: 3
That's exactly what I needed to know. Thanks a bunch.
RocketRay is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compilation problem Naveen Kumar D Linux Desktop / X-Windows 12 03-05-2007 01:09 PM
Package Update Errors (8 of them) Arkhan Redhat / Fedora Linux Help 13 01-16-2007 08:02 PM
iPod Mount Changes Permissions [Solved] Kenji Miyamoto Peripherals / Hardware 7 10-07-2006 10:43 PM
Server: "File does not exist" error JosHost Servers 0 03-09-2006 12:25 PM
Linux File Permissions GoldenEye Linux Tutorials, HOWTO's & Reference Material 0 07-16-2004 01:50 PM




All times are GMT. The time now is 08:56 PM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0