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


Click here to return to the 'more explanation' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
more explanation
Authored by: hayne on Jan 03, '03 11:38:02AM

I realized I should explain how this works.
The file /dev/null is an empty file which comes standard with all UNIX installations.
(That's simplifying a bit but will do for current purposes.)
Copying this empty file onto the resource fork effectively wipes out the resource fork.
It is necessary to do it this way since the OS prevents removal of the resource fork via 'rm'.

\!:1 is the first argument following the name of the alias when it is invoked - i.e. it is the name of the file. E.g. if I do:
rmrsc foo
then \!:1 is "foo"
The resource fork of a file named "foo" can be referred to as foo/..namedfork/rsrc and this is what I use in the above alias.
The data fork of a file named "foo" can be referred to as: foo/..namedfork/data but that is less useful since standard UNIX utilities act on the data fork anyway (which is the point of the original hint).
Note that this more convoluted naming (foo/..namedfork/rsrc) is now the officially recommended way of referring to the resource fork - the use of the simpler foo/rsrc is still supported for backward compatibility.



[ Reply to This | # ]