Hi,

On 14 Jan 2002, Erez Doron wrote:

> when i do 'ls -l' , i get the file modification time
> how do i get file creation time ?

In Linux, or in Unix in general, you can get all the information about a file
by the stat(2) function, and utilities like `ls' or `find' just use it. As you
can see from the manual of stat(2), which is pretty elaborate, file creation
time is not available. On each file or directory you have three times: atime --
time of last access, mtime -- time of last modification, ctime -- time of last
change. stat(2) explains exactly what each one means. For example, mtime is
changed when a file is written into, or a directory is modified by adding a
file into it. However it does not change e.g when the file mode (rwx) is
changed.  ctime, however, will change in either case. Again, you can read in
stat(2) exactly what is available, and either ls or find will print it for you
if you wish. But, file creation time is not available, and once the file is
modified, the creation ("initial modification") is lost.

However, while writing this reply, I found out that the <ext2fs/ext2_fs.h>
header file has the structure of the inode on the disk, and the time fields it
has are
        __u32   i_atime;        /* Access time */
        __u32   i_ctime;        /* Creation time */
        __u32   i_mtime;        /* Modification time */
        __u32   i_dtime;        /* Deletion Time */

I don't have any information about these, and how to access them. If somebody
can enlighten us, I'll be grateful.

Kol tuv,

Zvi.

-- 
Dr. Zvi Har'El     mailto:[EMAIL PROTECTED]     Department of Mathematics
tel:+972-54-227607                   Technion - Israel Institute of Technology
fax:+972-4-8324654 http://www.math.technion.ac.il/~rl/     Haifa 32000, ISRAEL
"If you can't say somethin' nice, don't say nothin' at all." -- Thumper (1942)
                               Monday, 1 Shevat 5762, 14 January 2002,  4:12PM


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to