Question

I'm working on an app,now i used openssh find and get access to my mac's file system,I can access every folder at my app.That dangerous for my computer,I want to know is there any way I can only get the shared folder at my app,instead every folder.Just like use mac to connect other people's share folder,only get the share folder.what should i do,and i'm thinking get the share folder path and use it as an argument,is that right?

Was it helpful?

Solution

You can use

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSSharedPublicDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"Playlist"];

if you want path of Documents directory replace first line by this

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top