|
|
|
|
|
by otakucode
3198 days ago
|
|
'Safe' filesystem access? Honest question, but what would that look like? How is my software going to know that inserting 'no' into my mail file or overwriting a file or creating a new one was a 'bad' operation? Aside from adopting an immutable content-addressable storage system (something like Camlistore) I'm not sure how filesystem access could ever approach 'safe.' But, I haven't given it a great deal of thought or reading, so you might be referring to something entirely different or have better ideas. |
|
Safety is a spectrum. Consider a file system API that didn't let you obtain access to a parent directory, and didn't let you ambiently designate any path you like via an unchecked string and turn said string into a real handle to whatever lies at that path. Your program starts with a handle to what it's allowed to reference.
Any subroutine you passed a directory handle then couldn't obtain anything outside of that path (effectively a jail), and any subroutine that wasn't passed any handles can't read or modify the file system at all.