Re: FSFileManager strange behaviour on OS X
Re: FSFileManager strange behaviour on OS X
- Subject: Re: FSFileManager strange behaviour on OS X
- From: Jens Alfke <email@hidden>
- Date: Fri, 31 Jul 2015 12:27:24 -0700
> On Jul 31, 2015, at 11:46 AM, Tim Fletcher <email@hidden> wrote:
>
> I have a Chose File dialog for the user to select a file (directory in this case). I retrieve the absolute path of the chosen directory.
> However, am not able to list the contents of the directory.
Is your application sandboxed?
But even so, I thought that NSOpen/SavePanel granted a sandboxed app permission to access the directory or file chosen by the user. (I’ve never actually used that functionality in a sandboxed app, though.)
> fs.isReadableFileAtPath("/Users/tim/Documents") // false
> If i print out fs.currentDirectoryPath dI do indeed get a weird path (assuming that this is the root of where the application has been built to and run from)
Looks like the process running Swift playground code is sandboxed. So it can’t access files outside its sandbox, which is that ‘weird path’ you saw.
—Jens
_______________________________________________
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