LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-05-2010, 10:43 AM   #1
password636
Member
 
Registered: Jun 2006
Location: Beijing
Posts: 60

Rep: Reputation: 1
meaning of timestamps in the inode structure


Hi,

The ext2 filesystem inode structure has 4 timestamps:
i_ctime
i_mtime
i_atime
i_dtime

I've found two kinds of explanations about them:

First one:
i_ctime - The time in which the inode was last allocated. In other words, the time in which the file was created.
i_mtime - The time in which the file was last modified.
i_atime - The time in which the file was last accessed.
i_dtime - The time in which the inode was deallocated. In other words, the time in which the file was deleted.

Second one:
i_ctime - 32bit value representing the number of seconds since january 1st 1970, of when the inode was created.
i_mtime - 32bit value representing the number of seconds since january 1st 1970, of the last time this inode was modified.
i_atime - 32bit value representing the number of seconds since january 1st 1970 of the last time this inode was accessed.
i_dtime - 32bit value representing the number of seconds since january 1st 1970, of when the inode was deleted.

One say those times are about the inode while one say those times are about the file. i_ctime and i_dtime can be understood. Either inode or file is the same. But what about the i_mtime and i_atime?
For i_mtime, inode modification equals to file modification?
For i_atime, inode access equals to file access?
Which saying is right?

Thanks in advance!
 
Old 08-05-2010, 10:53 AM   #2
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
Both are same. Generally we access files through its name and system access through inode. when we create file inode automatic allocated by system.

look here to understand inode structure.

Last edited by sem007; 08-05-2010 at 10:56 AM.
 
Old 08-06-2010, 04:55 AM   #3
password636
Member
 
Registered: Jun 2006
Location: Beijing
Posts: 60

Original Poster
Rep: Reputation: 1
Hi Sem007,

Sorry ... I still don't get it. Question is still about i_atime and i_mtime. If a member of i_node structure (say i_mode) is accessed (say by stat()), does this mean the file is also accessed? I mean, an inode has many members, does access to each member mean an access to the file? Same doubt with i_mtime. Does modification to each member mean modification to the file?

Thanks
 
Old 08-06-2010, 06:24 AM   #4
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
letís I try to explain

File has two types of data metadata and actual data. Inode contains metadata like filename, permission, time stamp, pointer etc and actual data stored on HDD sector. When user create file, Filesystem allocate one free inode to that file. in other word filename link to inode. When user access files indirectly inode is access.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
To lock inode structure saranraj Linux - Newbie 1 03-03-2010 12:04 AM
How to add new attribute to the inode structure ramyayella Ubuntu 5 02-04-2010 05:33 AM
Symbolic linking and inode structure tintintin Linux - General 0 01-21-2008 05:32 PM
Inode file_lock structure sid18 Linux - Kernel 0 09-09-2007 01:13 AM
adding flag in inode structure vishalbutte Programming 6 01-25-2006 02:24 PM


All times are GMT -5. The time now is 05:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration