onedrive-fuse
Mount your Microsoft OneDrive storage as FUSE filesystem.
Usage
Use your package manager to install dependencies:
- openssl
- fuse (libfuse)
Install it from crates.io:
For the first time, you should register your own Application (Client) ID for the API access.
Read doc/register_app.md for steps.
Login to your OneDrive account with Client ID of your own application.
This will prompt a browser window to ask you to login your Microsoft account for OneDrive.
After a successful login, the page will redirect your to a blank page whose URL contains nativeclient?code=,
then copy the FULL URL, paste it to the terminal and press enter to login.
# Login with read-only access.
# Or login with read-write access.
# onedrive-fuse login --read-write --client-id <paste-your-client-id-here>
Your access token will be saved to to XDG config directory,
which is default to be ~/.config/onedrive-fuse/credential.json.
Finally, mount your OneDrive to a empty directory.
It works in foreground by default, the terminal window should be kept opened.
It will fetch the whole tree hierarchy before mounting,
please wait for FUSE initialized to be shown and the filesystem is now mounted.
# Or if you want to read-writea access. The token must be authorized to have read-write access.
# Use it with care. Bugs may corrupt your OneDrive data.
# onedrive-fuse mount ~/onedrive -o permission.readonly=false
Umount the fuse filesystem gracefully.
You should NOT directly Ctrl-C or kill the onedrive-fuse instance.
Warning: Wait your upload session to be finished before umounting the filesystem. Currently we don't yet implemented waiting for uploading before shutdown.
Features implemented
- FUSE syscalls
- Read
- access
- forget
- getattr
- lookup
- open
- O_RDONLY
- opendir
- read
- readdir
- release
- releasedir
- statfs
- Write
- create
- mkdir
- open
- O_WRONLY/O_RDWR
- O_TRUNC
- O_EXCL
- rename
- rmdir
- setattr
- size
- mtime
- unlink
- write
- Other
- destroy
- flush
- fsync
- fsyncdir
- init
- Unsupported
- bmap
- getlk
- getxattr
- link
- listxattr
- mknod
- readlink
- removexattr
- setlk
- setxattr
- symlink
- Read
- Cache
- Statfs cache
- Inode attributes (stat) cache
- Directory tree cache
- Sync remote changes with local cache
- File read cache
- File write cache/buffer
License
GPL-3.0