Programmatically create aliases to unmounted servers?
Programmatically create aliases to unmounted servers?
- Subject: Programmatically create aliases to unmounted servers?
- From: "Zajkowski, James" <email@hidden>
- Date: Tue, 24 Jan 2012 22:24:26 +0000
- Thread-topic: Programmatically create aliases to unmounted servers?
All,
I'm looking for a way to construct an alias file (a bookmark file) with a specific but unmounted file server location. That is, I want to put an icon on user's desktops that says "Network Space" and have it resolve to afp://ser.ver.add.ress/mount/username.
I can create an NSURL with the encoded path correctly, and I've tried to construct a bookmark file using NSURL's -bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error: and + writeBookmarkData:toURL:options:error:. When I use a "smb" or "afp" URL I get a file that, when double clicked, opens in TextEdit with the contents of the bookmark file (that is, the URL). I'm pretty sure my code is correct because if I change the URL to a local file I get a working bookmark file. It also works if I construct the URL to a local path when the server is mounted (/Volumes/Server) - unmounting and opening the bookmark will re-mount the server.
I've stared at the NSURL and File Manager references and it seems like there's no way to go from a text server reference to a bookmark file. Is there a way to make an alias without mounting the server first?
Thanks,
--Jim
_______________________________________________
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