in reply to Re: How to get the File creation date
in thread How to get the File creation date
There is an API to modify an NTFS's file "creation time" - so it could be that although Windows has the "creation time" concept, it is not guaranteed that the time you get is really the "creation time" as anybody with the appropriate permissions could have modified that time! Whoa!
Access to the Windows "creation time" requires the Win API and is not part of "standard Perl".
So: some file systems track "creation time". Unix file systems are not one of them. Normally the "last modified" time is sufficient. And that's a good thing as that is all Perl allows you to get to with the standard built-in functions. But as a "nit" here, I point out that some filesystems do track creation time.
I think that the OP would do well by measuring the shortest of these parameters:
-M Modification age (measured in days)
-A Access age (measured in days)
If you haven't read a file or modified it within X days, then I would say that it is a "candidate for deletion". Under this kind of a test, I don't see how when the file was originally created makes a difference. If it not being used or modified, then who cares? Implement something like the Windows Trash Folder. Instead of deleting a file outright, move it there and wait for Y days to see if anybody really misses it! If you don't get any complaints, then do a final deletion.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to get the File creation date
by MidLifeXis (Monsignor) on Aug 19, 2010 at 12:37 UTC | |
by Marshall (Canon) on Aug 19, 2010 at 16:20 UTC | |
by MidLifeXis (Monsignor) on Aug 19, 2010 at 17:13 UTC | |
by Marshall (Canon) on Aug 19, 2010 at 23:38 UTC |