Darn Non-Invisible Symlinks
Posted February 21st, 2006 @ 12:27pm by Erik J. Barzeski
For some reason, etc
, tmp
, and var
are showing up in the root directory of my hard disk. I attempted to set the invisible bit on them (with SetFile). It didn't work because it attempted - I believe - to set the invisible bit on the directory they're linked to. What gives?
rwxr-xr-x 1 root admin 11 Oct 18 13:26 etc@ -> private/etc
lrwxr-xr-x 1 root admin 11 Oct 18 13:26 tmp@ -> private/tmp
lrwxr-xr-x 1 root admin 11 Oct 18 13:28 var@ -> private/var
% GetFileInfo var
directory: "/private/var"
attributes: avbstclinmedz
created: 03/28/2005 01:39:10
modified: 02/20/2006 18:48:28
How can I hide these darn puppies again?
Posted 21 Feb 2006 at 12:50pm #
Do you have a .hidden file in your / ?
Posted 21 Feb 2006 at 1:05pm #
No, and I shouldn't need one just to hide these files.
Posted 21 Feb 2006 at 1:43pm #
From what do you want to hide them? From ls, Finder, or something else? It looks like you want to hide them from the command line... I don't know any way to do that, but it really makes me wonder: why?
Posted 21 Feb 2006 at 1:56pm #
Sorry, I didn't clarify exactly. I want to hide them from view in the Finder. I'm not even an admin user, yet I can see these symlinks (though not the others). I only used the Terminal to show some of the attributes.
Posted 21 Feb 2006 at 1:58pm #
At one time it was /.hidden, but I see I don't have that file on my iMac Core Duo yet those links are hidden.
Posted 21 Feb 2006 at 2:01pm #
They've only recently appeared, and I'm not sure why nor how to get them to "go away" again.
Posted 21 Feb 2006 at 2:28pm #
Did you try to give the -P option to SetFile? This is supposed to make it not follow the symlink. On my system:
/$ /Developer/Tools/GetFileInfo var
directory: "/private/var"
attributes: avbstclinmedz
created: 03/27/2005 22:39:10
modified: 02/14/2006 00:05:57
/$ /Developer/Tools/GetFileInfo -P var
file: "/var"
type: "slnk"
creator: "rhap"
attributes: AVbstclinmedz
created: 07/24/2005 19:09:34
modified: 07/24/2005 19:09:34
Posted 21 Feb 2006 at 2:34pm #
Have you tried running fix permissions in disk utility? That might fix the problem right up.
Owen
Posted 21 Feb 2006 at 2:46pm #
Fix permissions is the first thing I try on anything. Not because it works frequently, but because it takes very little time and can't hurt.
I didn't try the -P. Thanks for pointing that out. Having done so, I was able to change the invisibility flag. That has solved the problem.
Thanks to one person for sending me their .hidden file. That's not needed (though it's still respected) in 10.4. It was a nice temporary fix if nothing else.
Thanks, Garth, for not calling me stupid and telling me to read the man pages for SetFile. I would have deserved it if you had done so, though. 🙂