Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have document files on my Windows 2000 that gives the file creation date in the "Date of Creation" part of the Properties Summary area of each document. I was hoping to write a Perl script to get this data. Please advise where this info is stored on a Windows 2000???

Perl has a stat function that will give me the access and modification date BUT not the creation date. Now that I see I can get that creation date in the Properties (under Summary, then click on "Origin" then it shows "Date of Creation") section of Word Documents I was wondering how I can get this info. Where is it stored so I can fetch it with perl script??
  • Comment on Fetching Properties info from a word document.

Replies are listed 'Best First'.
Re: Fetching Properties info from a word document.
by John M. Dlugosz (Monsignor) on Aug 20, 2002 at 16:16 UTC
    In a Word Document, it uses the COM "Compound Document File", and these properties are part of that file format.

    You might look at IPropertySetStorage in a OLE book.

    Also, the Word document model might support getting this value directly.

    —John

Re: Fetching Properties info from a word document.
by grummerX (Pilgrim) on Aug 20, 2002 at 16:16 UTC
    The ctime value from stat does give you the file creation time on Windows, but not on Unix filesystems -- in their case ctime returns the inode change time rather than the file creation time. For example, this script prints out its own creation time:
    #!perl -w use strict; use POSIX; my $file = $0; print strftime "Created: %Y-%m-%d %H:%M:%S", localtime ((stat $file)[1 +0]);

    -- grummerX

Re: Fetching Properties info from a word document.
by mjeaton (Hermit) on Aug 20, 2002 at 14:53 UTC
    See Win32::OLE

    mike