473,289 Members | 2,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

File Created Date?

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
6 14374
>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
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
-----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
>> >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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: [ EuGeNe ] | last post by:
Hi all, I would like to write a script that downloads one file from a ftp server if the file creation date satisfy a condition. I can't figure out how to find from a ftp server what is the...
1
by: Daniel | last post by:
when writing out a file from .net, when is the file created? after the bytes are all written to the hard drive or before the bytes are written to the hard drive?
2
by: Robizzle | last post by:
Sorry, I must be blind but I can't seem to find it anywhere. What function will return the time a file was created? I see filemtime(...) returns the time that file was last Modified and...
4
by: John | last post by:
Is there anyway to refer to an object's (e.g., a table) created date in VB? The reason is I need to see the data set's "date effective", which for me would be the date the table was created. I...
4
by: wil | last post by:
Dear All, In the linux platform, is there anyway I can in a C program change the file create date? Thanks, wil.
1
by: Peri | last post by:
Dear All, I am developing 2 applications. The first application will keep on generate a new file in a span of 30 milliseconds with some valid data inside (This code is written in C). The...
1
by: questionit | last post by:
I am trying to use DateCreated property of RecordSet but getting error. Set db = CurrentDb Set rst = db.OpenRecordset("SELECT name FROM Table1") If i try: While rst.EOF = False ...
4
by: Redeemed1 | last post by:
Can any one help me? I need to retrieve the created date of a given table in MS Access using VBA. (If the date = today's date then I will run my query, else I will have to wait until the table has...
1
by: Enij | last post by:
Hi All, I'm using VB.net 2003 Standard Edition, and I'm trying to retrieve the file modified date. Sounds painfully simple. Yup. But ... I cannot, for the life of me, figure it out. After...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.