Hi all,
I'm trying to programmatically mount some WebDAV shares and I'd like to give the volumes specific names other than the default. For example, if I mount
https://my.sharepoint.school.edu/personal/grigutis
I'd like it to appear in the Finder as
/Volumes/My SharePoint Site
Instead of
/Volumes/grigutis
I can do this with the mount_webdav command:
$ mkdir /Volumes/My\ SharePoint\ Site
$ mount_webdav -s https://my.sharepoint.school.edu/personal/grigutis /Volumes/My\ SharePoint\ Site
But I can't get this working with NetFSMountURLSync:
NSURL *url = "" URLWithString:@"https://my.sharepoint.school.edu/personal/grigutis"];
NSURL *mountpath = [NSURL fileURLWithPath:@"/Volumes/My SharePoint Site"
isDirectory:YES];
CFArrayRef mountpoints = NULL;
result = NetFSMountURLSync((__bridge CFURLRef)url,
(__bridge CFURLRef)mountpath,
CFSTR("Kerberos"),
CFSTR("NoPassword"),
NULL,
NULL,
&mountpoints);
If the mount path directory exists, I get the Finder dialog:
'There was a problem connecting to the server "my.sharepoint.school.edu". You do not have permission to access this server.'
and the function returns result 13.
If the mount path directory does not exist, I get the Finder dialog:
'There was a problem connecting to the server "my.sharepoint.school.edu". The share does not exist on the server. Please check the share name, and then try again.'
and the function returns result 2. Calling the function with NULL for the mountpath argument works as expected.
The only documentation I can find is in NetFS.h. Does anyone see anything wrong with my code or is this a bug?
--
John Anthony Grigutis
Systems Analyst/Programmer/Mac Specialist
UITS Support Systems, Licensing, & Software Distribution
|