From: "Wagner, David --- Senior Programmer Analyst --- WGO" 
        <[EMAIL PROTECTED]>
>       stat will give me the mod time, but does not have the create
> time. From Windows Explorer, I notice that I can get the Create Date.


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 meanings 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 in seconds since the epoch (*)
         11 blksize  preferred block size for file system I/O
         12 blocks   actual number of blocks allocated

        (The epoch was at 00:00 January 1, 1970 GMT.)

        (*) Not all fields are supported on all filesystem types.
        Notably, the ctime field is non-portable. In particular, you
        cannot expect it to be a "creation time", see "Files and
        Filesystems" in perlport for details.

The docs are still pretty Unix-centric it seems. "inode change time" 
... lovely. In particular, under Windows, this is the creation time.



perldoc perlport
 ...
stat 
  Platforms that do not have rdev, blksize, or blocks will return 
  these as '', so numeric comparison or manipulation of these fields 
  may cause 'not numeric' warnings.

  - mtime and atime are the same thing, and ctime is creation time 
    instead of inode change time. (Mac OS).

  - ctime not supported on UFS (Mac OS X).

  - ctime is creation time instead of inode change time (Win32).
...


Jenda
P.S.: Guys, when was the last time you wanted to know the "inode 
change time"? Looks to me like this is just a case of "bug claimed to 
be a feature" that Microsoft is otherwise famous for. stat() was 
supposed to return the creation time, but someone failed to notice 
inodes can change, and instead of fixing the issue and giving the 
users what they ask for the docs were updated and the bug was turned 
into a feature.
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to