Folders becoming Documents in OSX

Discussion in 'Apple' started by Tim Bradshaw, Mar 18, 2007.

  1. Tim Bradshaw

    Tim Bradshaw Guest

    Apologies if this is a FAQ.

    We have a Mac (a ppc mac mini) running 10.4.9. My background is in
    Unix (I'm a Solaris SA) but I know almost nothing about the Mac, which
    may bias the following discussion.

    Some time in the last little while, something happened that made the
    finder decide that my wife's home directory was not a folder but some
    kind of document which it didn't know what it was. If she tried to
    browse it it would ask her what application to use. When I opened /
    Users it would show up as the standard `I don't know what this is'
    blank document and it would ask me what to open it with as well.

    I'm aware that a lot of documents (and applications) on the mac
    actually are directories to Unix with specific structure inside them,
    so I thought something must have appeared inside her home dir which
    confused the Finder. So I got rid of most things that I could think
    of, either deleting obvious rubbish, or moving things into a
    subdirectory called "stuff", which I figure the finder will not poke
    into. In particular I got rid of .DS_store and similar things. I kept
    the standard Library, Documents etc dirs. No good.

    So, in desperation, I did the following as root:

    - made a scratch dir /Users/scratch;
    - moved /Users/ga (her directory) into /Users/scratch;
    - made a new /Users/ga & set ownership & perms right;
    - moved everything inside /Users/scratch/ga (including all the dot
    files) into /Users/ga

    And this seems to have worked: now it knows it is a folder.

    *But* I did the same thing a couple of days ago, and while it worked
    for a couple of days, it then reverted back to the bad thing & I'm
    expecting that to happen again.

    So: is there something I am missing? Where *does* the Finder keep
    track of what sort of thing something is? this must be something that
    has happened before.


    Tim Bradshaw, Mar 18, 2007
    1. Advertisements

  2. Tim Bradshaw

    Tom Stiller Guest

    If you have the Developer Tools installed, use GetFileInfo to see if the
    "bundle" attribute bit is set ("B" set, "b" not set). The attributes
    can be changed with SetFile.
    Tom Stiller, Mar 18, 2007
    1. Advertisements

  3. Use Finder's Get Info to remove any filename extension, especially
    ".pkg" or ".app", at the end of the folder's name. If that doesn't fix
    it, the folder's file system metadata may have been altered to flag it
    as a package.

    If you haven't already done so, install the Developer or Xcode software,
    set your shell's path to include /Developer/Tools, where SetFile and
    GetFileInfo are installed, and read the man pages for those commands. If
    GetFileInfo shows an uppercase "B" ("Has bundle") among the folder's
    attributes, use SetFile to toggle it to the lowercase ("not") setting.
    Neill Massello, Mar 18, 2007
  4. Tim Bradshaw

    Király Guest

    Yes, I had this happen with two applications after the 10.4.9 update.
    The system seemed to think each was a file, even though the apps were
    both folders with enclosed files (like most apps.)

    In each case, the UNIX permissions on the apps seemed to be correct:

    But something in the system was flagging the apps as files anyway.

    The solution was to rebuild the Launch Services database. Google for a
    Terminal command for this, or download Cache Out X, which provides a
    simple GUI button to do it.
    Király, Mar 18, 2007
  5. Tim Bradshaw

    Tim Bradshaw Guest

    It definitely has no extension, but ...
    I do have this but had not worked out that this was what I might need
    to do. Thanks both to you & Tom Stiller for suggesting this - I'll
    try it this evening. Also thanks to Király - the launch services
    thing sounds like a good idea too.

    Tim Bradshaw, Mar 19, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.