is there relation between modify time & change time of file
whenever i am modifying data in file ,its getting change in modify time as usual.and change time too.
is there any relation between modify & change time? |
Quote:
Do you mean "Accessed: ..." time? If so, the "Modified: ..." means when the file was modified in some way. The "Accessed: ..." means when the file was last opened. |
The change time (ctime, as returned by "ls -lc") records that last time fields in the inode were changed, and that is more inclusive than the modification time (mtime), which just records the time the content of the file itself was changed. The only inode change that does not result in a ctime update is the automatic change to the access time when the file is read. Everything else, including a change to mtime, permissions, link count, SELinux context, etc., does result in a ctime update.
There is a system call (as used by touch) that allows the access and/or modification times to be set to arbitrary values. There is no such provision for modifying ctime. Note that changing the time access or midification times in this manner does result in an ctime update. |
what i mean is , when i am using stat command with file it is showing three times like access ,modify , change.
access time indicates last time read modify time indicates last data changed or modified for particular file change time indicates last metadata got changed. my query is when ever i am modify data, its effecting not only in modify time and change time too does modify time , change time have any relation? hope u got my question. please let me know thanks in advance |
I thought rknichols' post pretty clearly answered your question...what of that do you not understand, please?
|
Quote:
But, whenever you change the data in the file, the metadata gets changed too, and thus both the modification time and the change time get set. So in that sense, they are related. Take your pick. |
screencast on atime,ctime and mtime.may be helpful here
|
thank you all. especially to giis.
i got clear idea about c-time and m-time |
Bear in mind, also, that many of these directory-entry timestamp values are not maintained, because it creates a great deal of disk-write activity for no actual useful purpose. Expect to find a useful indication of when the file was created, but not when it was last modified or opened.
|
All times are GMT -5. The time now is 04:53 AM. |