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


Click here to return to the 'A script to rm things to the trash' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to rm things to the trash
Authored by: nherring on Apr 30, '07 12:57:32PM

If you have multiple volumes, there are trash folders per volume. You may end up with unexpected failures if you move a file from one volume that has enough space to hold it to your boot volume that doesn't. It's not immediately obvious to me how one would determine what volume the file is on (though you could use some heuristics involving whether the full path started with /Volumes or not) in order to determine which .Trashes folder to use. Furthermore, Apple may very well change their implementation of the trash folder...

Ultimately, it might actually be cheaper to farm the entire process off to the Finder (assuming you're in a LoginWindow session) using an apple event via osascript. That way you get the stock Apple filename collision renaming scheme for the OS, etc.



[ Reply to This | # ]