Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creation date and time.

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Anyone know of a way to get the creation time of a file on a NT?

I tried the stat funciton inode creation but got the last modification time instead.
It doesnt want to pick up the actualy date and time the file was created.
Is this something Perl cant do and I need to look for a more high level language to get this information???
 
If Perl can do it, my guess is that the "stat" function would be *the* function. But according to 'perldoc -f stat'

stat FILEHANDLE
stat EXPR
stat Returns a 13-element list giving the status info
for a file, either the file opened via FILEHANDLE,
or named by EXPR. If EXPR is omitted, it stats
"$_". Returns a null list if the stat fails.
Typically used as follows:

($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat($filename);

Not all fields are supported on all filesystem
types. Here are the meaning of the fields:

0 dev device number of filesystem
1 ino inode number
2 mode file mode (type and permissions)
3 nlink number of (hard) links to the file
4 uid numeric user ID of file's owner
5 gid numeric group ID of file's owner
6 rdev the device identifier (special files only)
7 size total size of file, in bytes
8 atime last access time in seconds since the epoch
9 mtime last modify time in seconds since the epoch
10 ctime inode change time (NOT creation time!) in seconds si
nce the epoch
11 blksize preferred block size for file system I/O
12 blocks actual number of blocks allocated

it doesn't look like file creation time is included. Hardy Merrill
 
It's not. stat() comes from UNIX, which doesn't store creation time. Mike
________________________________________________________________

"Experience is the comb that Nature gives us, after we are bald."

Is that a haiku?
I never could get the hang
of writing those things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top