Hello,
fstat() function gives us the details about a file.
can anyone explain the difference between "mtime" (last modification time) and "ctime" (last change time) ........ what is the difference between modify and change
Thanks,
Vishwa Vivek
[man]fstat[/man] links to [man]stat[/man] and [man]stat[/man] says:
Here's what the UNIX man page on stat has to say about the difference between a file change and a file modification: st_mtime Time when data was last modified. Changed by the following functions: creat(), mknod(), pipe(), utime(), and write(2). st_ctime Time when file status was last changed. Changed by the following functions: chmod(), chown(), creat(), link(2), mknod(), pipe(), unlink(2), utime(), and write(). So a modification is a change in the data, whereas a change also happens if you modify file permissions and so on.
Here's what the UNIX man page on stat has to say about the difference between a file change and a file modification:
st_mtime Time when data was last modified. Changed by the following functions: creat(), mknod(), pipe(), utime(), and write(2).
st_ctime Time when file status was last changed. Changed by the following functions: chmod(), chown(), creat(), link(2), mknod(), pipe(), unlink(2), utime(), and write().
So a modification is a change in the data, whereas a change also happens if you modify file permissions and so on.
sometimes it's good toread the user contributed notes g
thanks 🙂
it is now clear to me