mountedLocalVolumePaths and fileAttributesAtPath strange behavior

  • Hi,

    I have a problem that I have some difficulties sorting out. I have a
    program where I have registered myself for
    NSWorkspaceDidMountNotification notifications from NSWorkspace. When I
    receive such a notification I check what volumes have been mounted by
    calling [[NSWorkspace sharedWorkspace] mountedLocalVolumePaths].

    In another part of the code I am checking for whether a certain file
    is valid or not depending on certain criteria. I have done that by
    calling the LSCopyItemInfoForRef routine (preceded by FSPathMakeRef in
    order to get the FSRef for the file in question which I need for the
    LSCopyItemInfoForRef call). Now the strange thing is that after the
    call to FSPathMakeRef I get a NSWorkspaceDidMountNotification
    notification. When calling mountedLocalVolumePaths as a response to
    this notification I suddenly have two new volumes, home and net. This
    corresponds to the two folders /home and /net on the / volume. I
    cannot understand why they suddenly appear in the list of mounted
    volumes. I have also tried calling [[NSFileManager defaultManager]
    fileAttributesAtPath: instead of the combination FSPathMakeRef/
    LSCopyItemInfoForRef but this yields the same result. As soon as I
    remove these lines (either FSPathMakeRef/LSCopyItemInfoForRef or
    fileAttributesAtPath) everything works fine with no extra volumes home
    or net.

    Does anyone have any idea what is going on here?

    Best regards,

    Henrik Eliasson
previous month january 2008 next month
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today