• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: network volume names changing etc.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: network volume names changing etc.


  • Subject: Re: network volume names changing etc.
  • From: Ken Thomases <email@hidden>
  • Date: Sun, 26 Jun 2011 20:48:11 -0500

On Jun 26, 2011, at 8:08 PM, Chris Idou wrote:

> I've noticed that Mac OS sometimes silently changes the UNIX mount name of
> network volumes. For example, if I mount a network volume of Media, it would
> normally be /Volumes/Media, but sometimes it isn't. For example, if another user
> on the same machine mounts Media first, then you might end up having it mounted
> as /Volumes/Media-1 or some such.
>
> Is there any document that discusses it? And what is the recommended way to
> store paths in this case? I don't know if its right, but I'm in the habit of
> storing UNIX paths, but this doesn't work very well for network shares because
> the UNIX path keeps changing because of the above. How can I store a path and
> get it back in a way that takes into account the above?

Best practice is to not store paths, but to store NSURL/CFURL bookmark data or, prior to 10.6, alias records.  Whether or not those will work in the face of the volume path changes you note, I don't know, but they are probably your best bet.  An alternative, just for network mounted volumes, would be to get the volume URL using FSCopyURLForVolume.  (For local volumes, the URL is roughly equivalent to the file path and provides no additional information.)

> Also as an aside, is there a way to have network volumes mounted for all users
> at once instead of just one user at a time?

I don't recall the specifics, but I believe so if the volume is mounted at boot rather than during a user session.  You can use fstab or the automount/autofs system to achieve this.

Regards,
Ken

_______________________________________________

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

References: 
 >network volume names changing etc. (From: Chris Idou <email@hidden>)

  • Prev by Date: network volume names changing etc.
  • Next by Date: Re: MFMailComposeViewController: referencing attached data in HTML body
  • Previous by thread: network volume names changing etc.
  • Next by thread: -(id)init methods, NSExceptions, and returning nil
  • Index(es):
    • Date
    • Thread