|
|
PATH_MAX Blackholing
Matt Gough's carbon-dev posting did a great job unearthing my previously repressed *nix trama: For those of you who don't know, *nix guys think it's a really good idea to represent file system entities as, of all things, strings. This is especially shocking, because *nix is written in C, and C's handling of strings is extremely deficient. With foresight and extra effort, you can easily deal with C's string inadequacy. Or, in the grand *nix tradition, you can cop out, write poor-quality code, and then blame the user when Things Go Wrong ("It's your fault! You shouldn't have run out of swap!"). One quick indicator of such shoddy code is the presence of Mac OS X uses Perhaps you can see the trouble brewing. At the very bottom is the file system code, which is robust and well-structured. Then a sloppy layer of path strings is slathered on top of that. Then we build our programs on top of that sloppy layer. It's as if you're building a house on a granite foundation, but before you start you lay down a six-foot thick blanket of tofu. Kind of defeats the purpose. Well, you don't have to use the tofu file system APIs. You can use Carbon's granite But! Hilarity ensues when you mix the competent "Blackholing" is a term I made up. It's possible -- easy, actually -- to construct a set of nested folders that will accept files placed into it, but won't let them out again. The recipe:
If you don't feel like doing this yourself, I wrote a small AppleScript applet that does this for you. Your victim file is now mostly inaccessible:
Probably the best way to rescue the file trapped in the blackhole folder's event horizon is careful use of AppleScript or coding directly to the Carbon APIs. You can file a bug against this if you want, but it will probably will be closed as duplicate and ignored. This bug is a design choice from 10.0, and I don't see Apple fixing it anytime soon. About the best we can hope for is that they patch up the Finder to allow dragging the file out again. But you already know my lack of optimism regarding the Finder. Update: Turns out you can navigate to the blackhole folder in zsh ( Tuesday, September 13, 2005
|
Contact Me Topics RSS Feed Linkblog
Bill Bumgarner Brent Simmons Daniel Jalkut Dave Dribin Eric Albert Eric Rescorla Eric Sink Greg Miller Gus Mueller Jeremy Zawodny John Gruber Mark Dalrymple Michael Tsai Peter Ammon Raymond Chen Ryan Wilcox Scott Stevenson Steven Frank The Daily WTF we hates software Wil Shipley |
Copyright © 1997-2010 Jonathan 'Wolf' Rentzsch. All rights reserved.
Questions? Comments? Contact Me.