By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 1,905 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

File Created Date?

P: n/a
I know about getlastmod() but is there one for created date?

If not is there some other way of getting the created date of a file?

Feb 13 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
>I know about getlastmod() but is there one for created date?

If not is there some other way of getting the created date of a file?


Very few operating systems keep the created date of a file.

Gordon L. Burditt
Feb 14 '06 #2

P: n/a
d
"Gordon Burditt" <go***********@burditt.org> wrote in message
news:11************@corp.supernews.com...
I know about getlastmod() but is there one for created date?

If not is there some other way of getting the created date of a file?


Very few operating systems keep the created date of a file.

Gordon L. Burditt


Apparently Windows does, and according to the PHP on-line manual's comments
at least, filectime() returns this.

dave
Feb 14 '06 #3

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gordon Burditt wrote:
If not is there some other way of getting the created date of a file?
Very few operating systems keep the created date of a file.


It's not about Operating Systems (Win, Linux, Mac), but File Systems (FAT,
NTFS, HPFS, UFS, ext2, ext3, ReiserFS, XFS, JFS).

Different filesystems keep different metadata about the files, but most of
them don't keep track of the creation time of the file. Have a look at
http://en.wikipedia.org/wiki/Stat_(Unix) for a better understanding of the
"ctime" field, which will be, in most cases, the closest you'll get to the
file creation time. Also, have a look at
http://es.php.net/manual/en/function.filectime.php and
http://es.php.net/manual/en/function.stat.php

- --
- ----------------------------------
Iván Sánchez Ortega -i-punto-sanchez--arroba-mirame-punto-net

http://acm.asoc.fi.upm.es/~mr/ ; http://acm.asoc.fi.upm.es/~ivan/
MSN:i_*************************@hotmail.com
Jabber:iv*********@jabber.org ; iv*********@kdetalk.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFD8S4z3jcQ2mg3Pc8RApz0AJ4798wVWUoSOL3esZQx9H skNMxvvACfbbw3
i2UuDYWjHcO26hpfUp4+Mcg=
=WaTX
-----END PGP SIGNATURE-----
Feb 14 '06 #4

P: n/a
>> >If not is there some other way of getting the created date of a file?
Very few operating systems keep the created date of a file.


It's not about Operating Systems (Win, Linux, Mac), but File Systems (FAT,
NTFS, HPFS, UFS, ext2, ext3, ReiserFS, XFS, JFS).

Different filesystems keep different metadata about the files, but most of
them don't keep track of the creation time of the file. Have a look at
http://en.wikipedia.org/wiki/Stat_(Unix) for a better understanding of the
"ctime" field, which will be, in most cases, the closest you'll get to the
file creation time. Also, have a look at


I disagree. On filesystems where both exist, *mtime*, not ctime
will be the closest to the file creation time. Unless someone has
been manually fiddling with the time stamps (as, for example, a tar
extract will do), ctime >= mtime.

Gordon L. Burditt
Feb 14 '06 #5

P: n/a
Gordon Burditt wrote:
If not is there some other way of getting the created date of a file?

Very few operating systems keep the created date of a file.


It's not about Operating Systems (Win, Linux, Mac), but File Systems (FAT,
NTFS, HPFS, UFS, ext2, ext3, ReiserFS, XFS, JFS).

Different filesystems keep different metadata about the files, but most of
them don't keep track of the creation time of the file. Have a look at
http://en.wikipedia.org/wiki/Stat_(Unix) for a better understanding of the
"ctime" field, which will be, in most cases, the closest you'll get to the
file creation time. Also, have a look at

I disagree. On filesystems where both exist, *mtime*, not ctime
will be the closest to the file creation time. Unless someone has
been manually fiddling with the time stamps (as, for example, a tar
extract will do), ctime >= mtime.

Gordon L. Burditt


Gordon

one of the reasons I like OpenVMS/RMS file system - while not impossible to
change, they are much more difficult than say your average UNIX file systems.

Created: 15-JUN-2004 08:59:14.67
Revised: 21-FEB-2005 05:05:51.56 (33) <-- how many times it has been modified
Expires: <None specified> <-- expire the file after this date
Backup: 25-OCT-2005 23:38:24.52 <== last date backed up (a bit out of date)
Effective: <None specified>
Recording: <None specified>
Accessed: <None specified>
Attributes: <None specified>

lots of bits to twiddle :) And I can notify the operator when a file is touched
for any reason (security and auditing).

unfortunately not in wide-spread use these days...

--
Michael Austin.
Consultant
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)
Feb 14 '06 #6

P: n/a
On 2006-02-13, Gordon Burditt <go***********@burditt.org> wrote:
I know about getlastmod() but is there one for created date?

If not is there some other way of getting the created date of a file?

filemtime, stat, fstat, lstat, `ls -lc $fname` ....
Very few operating systems keep the created date of a file.


Linux, and and anything with VFAT or NTFS ( = windows-32bit+) do.

I'd be surprised if BSD or OS/X are different.

which OS's don't?
Under linux the "creation" date is really the date of last change of the inode
(last time the file changed size or access permissions) and the
modification time is the time the file data was written.

access time is the last time the file content was read, VFAT only stores
the access date IIRC. dunno about NTFS.


Bye.
Jasen
Feb 14 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.