Hi btrott,

   I'm afraid your method doesn't always work... I've been wanting to retrieve last accessed time by using this method and even though it works fine with Win NT4, it fails with Win98 and 2000. It only returns the date when the folder was last accessed. Time is set to midnight (00:00:00) and the epoch stamp ends with 3 zeros.
   As a matter of fact, if you have a look at the folder's properties by right-clicking on it, you won't get much further - it seems like the time property was forgotten altogether in Windows as far as access time is concerned (it still is there for modified time).
   I'm much annoyed by this fact and don't really know how to get round this little glitch. I later found on a Windows website (http://windows.about.com/library/tips/bltip343.htm)that timestamping could be disabled on NTFS-based systems, but Win98 isn't one...
   Furthermore last modified time is only updated when a file directly in the considered folder is changed/created/deleted ie if the folder you're looking at is c:\hello and c:\hello\good\win\test.htm is updated, then only good's modified timestamp will have changed (which we must admit isn't very logical).

   is all hope lost ? Please help if you've any idea...

Originally posted as a Categorized Answer.


In reply to Re: How do I get the last accessed time for directory? by Foggy Bottoms
in thread How do I get the last accessed time for directory? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.