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


Click here to return to the 'Is there a trash spec ?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Is there a trash spec ?
Authored by: rahulbenegal on Apr 23, '10 10:09:06PM

Is there a spec for how to interact with trash as in freedesktop.org:
http://www.freedesktop.org/wiki/Specifications/trash-spec

I found a script named tr.sh (perl) which works with Linux and other systems. The author wants to now if there's a spec so he can modify it for OS X. It maintains a folder called files and info, and a metadata file. It stores date of deletion, folder info (so no overwriting similar named files).



[ Reply to This | # ]
No trash spec.
Authored by: GaelicWizard on Apr 24, '10 11:19:16AM

The spec on freedesktop is not a "this is how things work" spec, but a "this is how we want things to work" spec. That script you found may be the only script which uses the spec, or maybe KDE and GNOME use it too. Mac OS X's trash is an entirely different beast using the same user-level metaphor. Microsoft Windows' Recycle Bin is, likewise, an entirely different beast from either of these, again using the same user-level metaphor. That tr.sh script will happily work just fine on Mac OS X, but it won't interact with Finder's trash unless you tell it to re-use the hidden folders which Finder uses, in which case it will likely only half-work. Likewise, Finder would likely empty tr.sh's metadata along with the rest of the trash.

The Finder itself actually treats the trash differently depending on which version of Mac OS X is running. The primary difference is in the formatting of the date and/or sequence number for adding duplicate files to the trash.

Additionally, there is no metadata of any sort stored in the trash until 10.6, where only "original location" is stored. (I have no idea _where_ that's stored. Once I figure it out, I'll update this script on sourceforge (see hint for link).)



[ Reply to This | # ]