Why is "shared" attribute set on a folder?

Discussion in 'Apple' started by Greg Pratt, Oct 15, 2005.

  1. Greg Pratt

    Greg Pratt Guest

    While recently playing with a file synchronization utility on a
    10.4.2 box, I noticed that there were some folders on one of the
    two computers where the "shared" attribute had been enabled. In
    all the research I've done, I've seen that this attribute is only
    meaningful on files, NOT folders. Indeed, Apple's own documentation
    (http://developer.apple.com/technotes/tn/tn1150.html) says that the
    underlying structure flag is only for plain files:

    kIsShared = 0x0040, /* Files only (Applications only) If */
    /* clear, the application needs */
    /* to write to its resource fork, */
    /* and therefore cannot be shared */
    /* on a server */

    I can't think of any reason why this might be set on a folder, other than
    an erroneous application having done so at some point in the past. There's
    no discernible pattern to which folders were having it attribute set, and
    which remained with the attribute cleared (i.e. application packages that
    are presented as single files to a user in the Finder).

    Does "kIsShared" serve ANY purpose on folder? Or is it harmless to run
    around and turn them all off with "SetFile -a m dirname" ?

    (FWIW, the program that exposed this oddity will see files as "different"
    if the HFS attribute flags don't match. It's obvious that some bits should
    be masked off from the comparison for folders, since they are meaningless
    to examine. I'll be reporting this as a bug to its author.)
    Greg Pratt, Oct 15, 2005
    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.