I was trying to mount a webdav share (Windows Server 2008r2) over NSTask. But had no luck.
NSString *server = @"https://domain;username:password@SERVER.tld:443/WDAV";
NSString *mountpoint = @"/Users/me/Desktop/MountPoint";
NSTask *task = [NSTask new];
task.launchPath = @"/sbin/mount_webdav";
task.arguments = @[server, mountpoint];
[task launch];
[task waitUntilExit];
int status = [task terminationStatus];
if (status == 0) {
NSLog(@"Mounted to Server");
} else {
NSLog(@"Mounted to Server failed with status code: %i", status);
}
Exit Code is always 22
.
When I try to connect over Terminal then I use /sbin/mount_webdav -i "https://SERVER.tld:443/WDAV" "/Users/me/Desktop/MountPoint"
An prom appear where I must type username in my case domain\username
and password. Works fine over Terminal, but over NSTask I have no idea.