Subscribe to
Posts
Comments
NSLog(); Header Image

Darn Non-Invisible Symlinks

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?

9 Responses to "Darn Non-Invisible Symlinks"

  1. Do you have a .hidden file in your / ?

  2. No, and I shouldn't need one just to hide these files.

  3. 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?

  4. 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.

  5. 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.

  6. They've only recently appeared, and I'm not sure why nor how to get them to "go away" again.

  7. 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

  8. Have you tried running fix permissions in disk utility? That might fix the problem right up.

    Owen

  9. 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. 🙂