4 ms·
The sandbox allows apps to open files via three methods: * Open dialogs * A limited number of files that have been opened in the past via open dialogs (intend
by namelost 9y ago
The sandbox allows apps to open files via three methods:
* Open dialogs
* A limited number of files that have been opened in the past via open dialogs (intended for e.g. recent files)
* Files that live in the app's sandboxed region of the filesystem.
That's it. So your text editor can't open ~/.bash_profile unless it pops up an open dialog and asks you to manually click it.
- X-Istence 9y agoWhich is a good thing for most users, just not the power users that would potentially want their editor to open ~/.bash_profile (although the downside is that if they were allowed to do so, they could do so silently as well... which is the problem Apple is trying to solve for).
- ntaoe09unteont 9y agoHow exactly is that a problem? You can open an open file dialog that is in the user's home directory and you can even select ".bash_profile" for them. All they have to do is click "OK" to start editing it. This gives them the security that your app can't just go and erase or overwrite or add malicious stuff to their .bash_profile without their consent, which seems like a really good idea!
- PeterisP 9y agoI'm a bit confused - if I explicitly want my text editor to open ~/.bash_profile, then I need to tell it that, which I would do through the Open dialog for GUI apps (or as a command line parameter for command line apps); and if I don't explicitly want to do so, then it probably shouldn't be opening it behind my back. This sandboxing would be a problem with editors that naturally work with multi-file projects (e.g. an IDE where you'd want to open a whole Java project of linked files), but in the text editor scenario this limitation seems to make sense.