-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: introduce an abstract file system interface into std #18324
Comments
Personally my biggest concern would be, if and how file system semantics can and can not be cleanly mapped and how to make these things explicit to the user (say how to make absence of flush needed to write a file an error to make things interchangeably usable).
|
Unpacking archives using something like the familiar
Could you elaborate on this? I don't understand what you mean. I share your semantics concern, the only solution I can think of is to not guarantee precise semantics of operations.
|
an abstract file system interface would also be useful in the context of certain kinds of gamedev resource loading, especially when space-constrained, especially if it could allow nesting/mounting, as that permits even nested archives etc in the asset file tree as needed by the game/application |
Jamie has an excellent talk on the differences in the context of databases, which has some simple performance examples:
Faster means, that you can get away without or potentially erroneous synchronization in the in-memory file system (msync & others), but not in the hardware-based file system (fsync & others). |
This would be great for tests as well that rely on platform specific search paths and what not, to validate that the search path logic works. |
@matu3ba one use case I would be intrested in would be custom file system for webserver hosted on embedded device. I would like to provide custom filesystem based on LittleFS with files stored in board flash memory. I think this relates to: #6600 Some inspirations: |
The problem: people may want to use libraries which could connect to things like Gvfs. The issue is that overriding stuff in
root
module is necessary to perform this.The solution:
std.fs
to include generic things such apath
(similar tostd.mem
but file system stuff)std.vfs
std.fs.local()
to the OS implemented file system interfaceThis will introduce a lot of incompatibilities but would make it possible to use other file system libraries with libraries which expect Zig's
std.fs
.VFS implementations:
The text was updated successfully, but these errors were encountered: