Re: FSMountServerVolumeSync and previously mounted volumes
Re: FSMountServerVolumeSync and previously mounted volumes
- Subject: Re: FSMountServerVolumeSync and previously mounted volumes
- From: Quinn <email@hidden>
- Date: Tue, 27 Jan 2004 11:17:24 +0000
At 12:23 -0500 23/1/04, David Feldman wrote:
I'm noticing that when my app calls FSMountServerVolumeSync for a
remote volume that's already mounted (in this case, by the Finder),
it registers success (i.e. returns 0). This might be OK - working on
a previously mounted volume is probably all right, although it would
be unfortunate if the user chose to unmount it while my app was
using it - but when my app is done and tries to unmount, that also
succeeds, unmounting the user-mounted volume. Is there anything I
can do to avoid this?
In the general case, no. Volume mounts aren't reference counted, so
there are all sorts of ways that you can get into trouble, especially
on a fully multitasking system like Mac OS X. However, one simple
heuristic you might try is to record the vRefNums of each mounted
volume before calling FSMountServerVolumeSync and then check whether
the vRefNum returned by your call is in the list of previously
mounted volumes. If it isn't, you mounted the volume.
S+E
--
Quinn "The Eskimo!" <
http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.