![]()
[<<]Message[>>] [<<]Author[>>] Subject[>>] Thread[>>]
Number : 2599 Date : 2002-08-04 Author : Kan Yabumoto Subject : The Last-Access timestamp Size(KB) : 3
I just posted an answer to Tom who asked a question for XXCOPY command line which deletes files that have not been accessed in the past 730 days. xxcopy xxcopy \src\ /rs/db#731/fa /DB#731 // on or before 731 days ago /FA // filedate using the Last Access value. Even though Microsoft introduced the concept of the Creation time and the Last Access time in addition to the Last Write (modify) time like in Unix, Microsoft failed to educate the programming community at large (including their own programmers at Microsoft) as to how to administer this timestamp value. As a result, there are so many programs that ignore the last-access timestamp, or more precisely, most programmers do not know how to follow the programming procedures in order to make the Last Access timestamp to be useful. For example, in order for the Last Access timestamp to be useful at all, certain file-copy programs which access the contents of a file (e.g., read-access) should not let the file system update the timestamp. For example, When you have the MYRESUME.DOC file in a directory, and if you access the file using Microsoft Word and read the file contents, you want the incident to be treated as a legitimate access which should be recorded by updating the last-access value. On the other hand, when you backup the file into some other directory for the sake of making sure the file is stored elsewhere, the backup operation itself (even though it involves a read access of the file contents, --- not just looking at the directory info for the file, or open without read access) should not be considered as a legitimate access which would trigger the timestamp update. That restricts very severely on which file-copy programs (and which file-maintenance utilities for various jobs) to use in order to do any access of the file contents. For example, if you use the Windows Explorer (by drag and drop) to copy the file, the operation constitute a read access, and therefore, the system will record it as the Last Access. Similarly, if you use the COPY command of the Windows, you will find the timestamp for the Last Access modified. As far as we know, there are only a few file-copy programs that preserves the Last Access timestamp (if a file-access program does not do any particular action with regard to the Last Access timestamp, the default behavior of the file system is to record the access as the Last Access). The MS Backup program is one such a program which "preserves" the LastAccess timestamp. BTW, XXCOPY does not modify the LastAccess timestamp (unless you force it to modify it by /TTA). How about system tools such as the GREP utility which opens files and reads the contents (which is an *ACCESS* as far as the file system is concerned)? If you scan a directory using GREP in search of some word, all the files the directory will receive a new "Last-Access" timestamp, unless the GREP program is aware of the implication and explicitly preserves the LastAccess value (I doubt most GREP utilities do this), the time- stamp will become quite useless. In other words, unless you discipline yourself to always use those LastAccess-preserving file management tools to copy the files (such as MS-BACKUP and XXCOPY), the LastAccess timestamp gets updated so often, the goal you are trying to achieve by removing those inactive files will likely disappoint you. As far as I'm concerned, the LastAccess timestamp is nearly useless. Kan Yabumoto
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.