SAFE Network
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Survey of RUST/FUSE FileSystem Libraries. ###### tags: `filesystem` `fuse` We are looking for a library or set of libraries that would enable us to have a single SAFE Network FileSystem codebase that operates on both unix and windows platforms. With that in mind, we list some options below: |Library/Crate|Platform(s)|Rust?|Stable?|Notes| |-------------|--|----|-----|-------| |[WinFuse](https://github.com/billziss-gh/winfuse)|Windows|Rust|No|supports WSL. Recommended [here](https://github.com/zargony/fuse-rs/issues/76#issuecomment-624880608).| |[fuse-rs](https://github.com/zargony/fuse-rs)|Linux,MacOS,FreeBSD|Rust|?|fully rust, not C bindings| |[Dokany](https://github.com/dokan-dev/dokany)|Windows|C++|?|use native windows API, but also includes [dokan_fuse API](https://github.com/dokan-dev/dokany/wiki/FUSE), in C++. Edward used this for [Safe.NetworkDrive](https://github.com/oetyng/SAFE.NetworkDrive)| |[dokan-rust](https://github.com/dokan-dev/dokan-rust)|Windows|Rust|?|[Unclear](https://github.com/zargony/fuse-rs/issues/76#issuecomment-267600155) if dokan-rust provides access to dokan_fuse API. more investigation needed.| |[fuse-mt](https://github.com/wfraser/fuse-mt)|Linux,MacOS,FreeBSD|Rust|?|fuse-rs fork. multi-threaded, path based API instead of Inode number.| |[polyfuse](https://crates.io/crates/polyfuse)|Linux,MacOS,FreeBSD|Rust|?|fuse-rs fork. Implements async/await| |[WinFSP](https://github.com/billziss-gh/winfsp)|Windows|C|Yes|includes FUSE compatibility layer. Said to be *very* stable. No rust bindings| WSL = Windows Subsystem for Linux. ### Initial Impressions On the unix side, fuse-rs is the most used and should be the most stable. At the same time, fuse-mt and polyfuse may be worth trying out since they have some desirable features. The fact that fuse-mt is path based (rather than inode) should make it easier to use, but also may create problems trying to share a single codebase with Windows. On the windows side, WinFuse may be the only real option for fuse+rust. There is dokan-rust, but it doesn't appear that it offers fuse compatibility. Probably it could still be used as the [API mapping](https://github.com/dokan-dev/dokany/wiki/FUSE#fuse--dokan-map) is close, we would just need a translation layer between the platform-independent lib and dokan-rust. ### Fuse Low Level API vs High Level API The C FUSE library offers [2 API levels](http://libfuse.github.io/doxygen/): The Low level API operates on inodes and is async. The high level API operates on paths and is sync. > libfuse offers two APIs: a "high-level", synchronous API, and a "low-level" asynchronous API. In both cases, incoming requests from the kernel are passed to the main program using callbacks. When using the high-level API, the callbacks may work with file names and paths instead of inodes, and processing of a request finishes when the callback function returns. When using the low-level API, the callbacks must work with inodes and responses must be sent explicitly using a separate set of API functions. Performance of the 2 APIs is reportedly similar. Which to use depends more upon use-case. [Discussion](http://fuse.996288.n3.nabble.com/Fuse-low-level-APIs-vs-high-level-td11940.html) Except: > When using the high level API, hard-linked files are replicated in the cache, which lead to inconsistencies unless you force zero for the cache duration. You do not have this issue with the low level API. What about rust libraries? * fuse-rs uses inodes. * polyfuse uses inodes. * fuse-mt uses paths. * syncer uses fuse-mt, (paths) on Windows: * WinFuse uses inodes. * dokan-fuse uses paths, but not implemented by dokan-rust. * winfsp fuse compat layer uses paths, but no rust impl. Path based API sounds attractive because we really don't have an Inode concept in SAFE. (Maybe an inode u64 can be mapped to an xorname?) However, for code portability between linux and windows, it may be better to use the low-level API, if possible. To go with path based API, the SAFE team may need to provide rust port or wrappers for either winfsp or dokan-fuse. Background on inode vs path API support in windows can be found [here](https://github.com/zargony/fuse-rs/issues/76) and [here](https://github.com/billziss-gh/winfsp/issues/94). ## Fuse Network Filesystems We aren't the first to create a networked files system. We might take some inspiration from other projects. ### Rust/Fuse |Library/Crate|FuseAPI|Notes| |-------------|----|---| |[Syncer](https://github.com/pedrocr/syncer)|rust-mt (path)|A filesystem that pretends you have all your files locally while caching only the most recently used. syncs via rsync over ssh| |[OneDrive Fuse](https://crates.io/crates/onedrive-fuse)|fuse-rs (inode)|access MS OneDrive cloudstorage. Only partially complete.| |[NetFuse](https://crates.io/crates/netfuse)|fuse-rs (inode)|tagline: *The fastest way to POC a network-backed filesystem.* provides an internally managed inode cache that allows abstracting FS operations into operations on paths. It is designed with the assumption that the backing store is over a network, so the implementation relies heavily on caching and lazy writing to improve perceived performance. last update: 2018.| |[soundcloud-fs](https://crates.io/crates/soundcloud-fs)|fuse-rs (inode)|a FUSE driver to serve audio files from SoundCloud. It is optimized to avoid needless API requests and aid mass indexing by music libraries, specifically MPD. last update Apr 2020| |[GCSF](https://crates.io/crates/gcsf)|fuse-rs (inode)|GCSF is a virtual filesystem that allows users to mount their Google Drive account locally and interact with it as a regular disk partition. more in this [paper](https://sergiu.ml/~sergiu/thesis.pdf).| ### Fuse, Other Languages |Library/Crate|Language|FuseApi|Desc|Notes| |-------------|---|--|--|--| |[ipfs](https://github.com/ipfs/go-ipfs/tree/master/fuse)|Go|?|Interplanetary FS. |Faces similar issues as Safe Network. two mount points: /ipfs and /ipns. after you use “ipfs daemon --mount”… you mount /ipfs/ as a read only directory but /ipns/your_id as a read-write directory. [fuse howto](https://willschenk.com/articles/2020/ipfs_and_fuse/). They seem to be using [API abstraction layer](https://github.com/ipfs/go-ipfs/issues/5003#issuecomment-486006313), similar to what we have been thinking of for SAFE Network | |[s3backer](https://github.com/archiecobbs/s3backer)|C|low (inode)|amazon S3. Uses a single local file to emulate a block device, that any other filesystem can format/mount eg ext2, etc.|intriguing, outside-the-box approach)| |[s3fs](https://github.com/s3fs-fuse/s3fs-fuse)|C++|high (path)|amazon S3. in-memory metadata caching, local disk data caching|| |[sshfs](https://github.com/libfuse/sshfs)|C|high (path)|mount remote server directory over ssh|has a directory cache.| ## Rust/Fuse In memory FileSystems |Library/Crate|FuseApi|Notes| |-------------|--|--| |[bpfs](https://github.com/bparli/bpfs)|fuse-rs (inode)|bpfs is a an in-memory filesystem written in Rust and built on the Rust-FUSE library|

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully