Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Securely empty trash via AppleScript after 'n' days' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Securely empty trash via AppleScript after 'n' days
Authored by: Dr. T on Feb 09, '09 11:03:21AM

I retract the above comment and add a warning.

I did not parse the script thoroughly. The script changes the modification date of every trashed file to the time of trashing.

WARNING: Changing the modification date is not a great idea for most files. For example, the modification data of an application or plug-in helps you know how old it is. If you accidentally trash it and then put it back, the modification date will be today, not two years ago. Some programs scan modification dates to see if the app or plug-in needs updating; such programs will be misled.

I recommend another approach. Create a text file for the Trash. Use a Folder Action Applescript to record the name of each file and the date it was trashed. At regular intervals, read the text file, find the files old enough for Trashing, see which ones are in the trash, and delete (or secure delete) them. Amend the trash file to include only what's now in the Trash. That should do it.



[ Reply to This | # ]
Securely empty trash via AppleScript after 'n' days
Authored by: Anonymous on Feb 09, '09 11:44:25AM

So you advocate engineering a whole new "Trash" schema, just because you consider throwing a file in the trash doesn't constitute "modifying" it?

Fair enough; each to their own.



[ Reply to This | # ]