file.dart icon indicating copy to clipboard operation
file.dart copied to clipboard

MemoryRandomAccessFile doesn't honor file system permissions

Open jamesderlin opened this issue 5 years ago • 0 comments
trafficstars

I'm adding a MemoryRandomAccessFile class (PR https://github.com/google/file.dart/pull/136). The current implementation does not do anything special to honor file system permissions. I have not looked closely at MemoryFile, but I suspect that it doesn't either.

Admittedly, file permissions are not very meaningful for an ephemeral MemoryFileSystem that is local to the running application; anything in it is something that the application put there, so it implicitly has permission to read or write or do whatever it wants.

However, honoring file permissions would improve testing fidelity (i.e., verifying that an application would behave correctly if permission errors are encountered). Note that dart:io currently provides no mechanism to modify permissions (see https://github.com/dart-lang/sdk/issues/15078), so MemoryFileSystem would need to provide its own.

jamesderlin avatar Jun 12 '20 21:06 jamesderlin