Add support for a C library exposing the filesystem API #22
Replies: 2 comments
-
BTW, GitHub has just opened "Discussions" to all public repositories (it must be enabled from the repository settings). Thus for example this "issue" would have been better discussed in there, as it's not actually a "bug" or clear "feature request". |
Beta Was this translation helpful? Give feedback.
-
At least the C++ library already exists: Indeed, a C API could probably done quite easily (at least for the read part). |
Beta Was this translation helpful? Give feedback.
-
I've taken a very quick look at the
dwarfs
FUSE application, and from what I've seen the code is extremely simple and clean, and basically just delegates operations to afilesystem_v2
object.So here is a thought: how about writing a small C (not C++) wrapper for the
filesystem_v2
class. Basically instead offs.find(some_path)
one would writedwarfs_fs2_find(fs, some_path)
; granted one now needs to provide similar accessor functions forentry_view
(and derived).Basically the C library should cover only the file-system "read", and provide only the most basic operations, similar to what FUSE needs. (In fact I think one could just hack the
dwarfs.cpp
and just fake FUSE calls to obtain such a library.)What's the point you ask? :)
Using DwarFS library inside other applications to access files stored in a
dwarfs
image, without mounting it via FUSE.For example:
Why a C library and not C++? It's easier to integrate it in other languages like Go, Rust, Erlang, etc.
Beta Was this translation helpful? Give feedback.
All reactions