Reputation: 1489
I am trying to write a small Mac command line app that can read and write XML files to a server on my local network. I have tried creating an NSURL like this:
NSURL *urlToFileOnServer = [NSURL fileURLWithPath:@"/Volumes/{name of folder}/{etc...}/file.xml" isDirectory:NO];
And then I check its existence with:
[urlToFileOnServer checkResourceIsReachableAndReturnError:&err]
but it always responds with file not found (I have confirmed that the file is there as seen by the finder).
Any ideas on what I am doing wrong with the URL? I am hoping that once I get the URL right I can use NSFileHandle to write to it. BTW... The file is on a MacMini running OS X server that I am accessing over WiFi.
Thanks!
Upvotes: 0
Views: 814
Reputation: 25041
You are forgetting the volume name: @"/Volumes/{volume name}/{name of folder}/{etc...}/file.xml"
Upvotes: 1