mountedLocalVolumePaths and fileAttributesAtPath strange behavior
mountedLocalVolumePaths and fileAttributesAtPath strange behavior
- Subject: mountedLocalVolumePaths and fileAttributesAtPath strange behavior
- From: Henrik Eliasson <email@hidden>
- Date: Thu, 17 Jan 2008 23:12:19 +0100
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
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden