https://github.com/vi/readwriteseekfs
In Rust, Expose Read+Write+Seek (or just Read+Seek) as a FUSE-backed regular file
https://github.com/vi/readwriteseekfs
Last synced: 8 months ago
JSON representation
In Rust, Expose Read+Write+Seek (or just Read+Seek) as a FUSE-backed regular file
- Host: GitHub
- URL: https://github.com/vi/readwriteseekfs
- Owner: vi
- Created: 2018-08-19T00:19:54.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-19T00:20:24.000Z (almost 8 years ago)
- Last Synced: 2024-11-01T10:42:14.218Z (over 1 year ago)
- Language: Rust
- Size: 4.88 KB
- Stars: 12
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
readwriteseekfs
---
A [`fuse::Filesystem`](https://docs.rs/fuse/0.3.1/fuse/trait.Filesystem.html) implementation based on any [`Read`](https://doc.rust-lang.org/stable/std/io/trait.Read.html)`+Write+Seek` implementation. Using this library you can easily expose file-like objects in Rust as a mountable single-file FUSE filesystem.
Read-only files can be crated from just Read+Seek, without Write.
Example
---
See [examples/simple.rs](examples/simple.rs) for the code.
## Running the example
First console:
cargo run --example=simple
Second console:
```
$ hd hello.txt
00000000 48 65 6c 6c 6f 2c 20 77 6f 72 6c 64 0a 00 00 00 |Hello, world....|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00010000
$ echo qwe > hello.txt
$ hd hello.txt
00000000 71 77 65 0a 6f 2c 20 77 6f 72 6c 64 0a 00 00 00 |qwe.o, world....|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00010000
$ fusermount -u hello.txt
```
Notes
---
* File size is determined using seeking at startup and is not changeable without unmounting