沙箱和目录列表
我做的一个常见任务包括使用 NSFileManager:contentsOfDirectoryAtPath 读取目录内容,但在 Lion 中启用沙箱是不可能的。
我知道用户必须从 NSOpenPanel 中选择目录以使沙箱满意(或删除它),但是我如何“通知”沙箱我必须从先前存储在某个配置文件中的路径读取目录而无需用户交互?
目前我已经设置了以下权利密钥
com.apple.security.files.user-selected.read-write
com.apple.security.documents.user-selected.read-write
com.apple.security.temporary-exception.files.absolute-path.read-write
A common task I do consists reading a directory content using NSFileManager:contentsOfDirectoryAtPath but enabling sandboxing in Lion this becomes impossible.
I know user must choose from a NSOpenPanel the directory to make Sandbox happy (or dropping it) but how can I "inform" sandbox that I must read directory from a path previously stored in some configuration file without user interaction?
Currently I've set the following entitlement keys
com.apple.security.files.user-selected.read-write
com.apple.security.documents.user-selected.read-write
com.apple.security.temporary-exception.files.absolute-path.read-write
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
沙箱当前不记得在应用程序启动之间允许访问文件系统上的哪些内容。
Apple 通过一些高优先级雷达对此进行跟踪,但我仍然建议您也提交自己的错误报告,以提高 Apple 内部的认识。
The sandbox currently doesn't remember what's it allowed to access on the file system between application launches.
This is tracked at Apple at some high-priority radar but I still suggest that you file your own bug report as well, to raise its awareness even higher within Apple.