tags:

views:

94

answers:

3

Is there any way to store file creation time in linux? May be filesystem that supports that. I mean CREATION TIME not mtime or ctime.

A: 

On NTFS using ntfs-3g you can access the creation time via an extended attribute (see attr(5)).

Ignacio Vazquez-Abrams
It's an option, but don't want to have deal with NTFS on linux.
t0ster
Well, your other option is HFS, and you *really* don't want to deal with HFS on Linux.
Ignacio Vazquez-Abrams
+1  A: 

Most (all?) Linux filesystems do not store the time when the file was created. Instead, they just store when the file was last modified, when it was last accessed, and when it last had an administrative action applied to it (e.g., changing its permissions). Of those, the best approximation to what you're looking for is usually the modification time.

Donal Fellows
On OS X there is way to get creation time of the file as well as ctime and mtime. I thought may be on linux too.
t0ster
@t0ster: HFS and HFS+ support creation time. ext2/3/4 does not.
Ignacio Vazquez-Abrams
A: 

If you want to store file creation times, you can use filesystem event notification tool like inotify.

It has system calls that make you aware of IN_CREATE (a file creation event) or some other event, When a file creation event happens you can simply log that with current time in a file of your preference.

Neeraj
It's also an option, I'll take a look.
t0ster