File Created Date?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • KoRnDragon

    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?

  • Gordon Burditt

    #2
    Re: File Created Date?

    >I know about getlastmod() but is there one for created date?[color=blue]
    >
    >If not is there some other way of getting the created date of a file?[/color]

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

    Gordon L. Burditt

    Comment

    • d

      #3
      Re: File Created Date?

      "Gordon Burditt" <gordonb.czonn@ burditt.org> wrote in message
      news:11v26qb8li 3a7c@corp.super news.com...[color=blue][color=green]
      > >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?[/color]
      >
      > Very few operating systems keep the created date of a file.
      >
      > Gordon L. Burditt[/color]

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

      dave


      Comment

      • Iván Sánchez Ortega

        #4
        Re: File Created Date?

        -----BEGIN PGP SIGNED MESSAGE-----
        Hash: SHA1

        Gordon Burditt wrote:[color=blue][color=green]
        > >If not is there some other way of getting the created date of a file?[/color][/color]
        [color=blue]
        > Very few operating systems keep the created date of a file.[/color]

        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


        - --
        - ----------------------------------
        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_eat_s_p_a _m_for_breakfas t@hotmail.com
        Jabber:ivansanc hez@jabber.org ; ivansanchez@kde talk.net
        -----BEGIN PGP SIGNATURE-----
        Version: GnuPG v1.4.2 (GNU/Linux)

        iD8DBQFD8S4z3jc Q2mg3Pc8RApz0AJ 4798wVWUoSOL3es ZQx9HskNMxvvACf bbw3
        i2UuDYWjHcO26hp fUp4+Mcg=
        =WaTX
        -----END PGP SIGNATURE-----

        Comment

        • Gordon Burditt

          #5
          Re: File Created Date?

          >> >If not is there some other way of getting the created date of a file?[color=blue]
          >[color=green]
          >> Very few operating systems keep the created date of a file.[/color]
          >
          >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[/color]

          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

          Comment

          • Michael Austin

            #6
            Re: File Created Date?

            Gordon Burditt wrote:
            [color=blue][color=green][color=darkred]
            >>>>If not is there some other way of getting the created date of a file?[/color]
            >>[color=darkred]
            >>>Very few operating systems keep the created date of a file.[/color]
            >>
            >>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[/color]
            >
            >
            > 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[/color]

            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
            :)

            Comment

            • Jasen Betts

              #7
              Re: File Created Date?

              On 2006-02-13, Gordon Burditt <gordonb.czonn@ burditt.org> wrote:[color=blue][color=green]
              >>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?[/color][/color]

              filemtime, stat, fstat, lstat, `ls -lc $fname` ....
              [color=blue]
              > Very few operating systems keep the created date of a file.[/color]

              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

              Comment

              Working...