# fuseftp
A Rust library for mounting FTP servers as FUSE filesystems.
## Usage
```rust
use fuseftp::{ServerConfig, FtpFilesystem};
use fuser::{MountOption, Session};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = ServerConfig {
host: "ftp.example.com".into(),
..Default::default()
};
let fs = FtpFilesystem::connect(&config)?;
let options = [MountOption::RW];
let mut session = Session::new(fs, "/mnt/ftp", &options)?;
session.run()?;
Ok(())
}
```
The `Session::run()` call blocks until the filesystem is unmounted.
## Features
| `tls` | Yes | Enables TLS support via [suppaftp](https://crates.io/crates/suppaftp)'s `native-tls` feature. |
| `clap` | No | Enables `clap` derives for config types (used by fuseftp-cli). |
### Default (with TLS)
```toml
[dependencies]
fuseftp = "0.1"
```
### Without TLS
```toml
[dependencies]
fuseftp = { version = "0.1", default-features = false }
```
## Limitations
- **File Permissions**: Changing file permissions requires support for
`SITE CHMOD`. This command is available on most Unix-based servers but not on
Windows-based servers, where permissions must be managed through the operating
system directly.
- **Symbolic Links**: Creating symbolic links requires support for
`SITE SYMLINK`, which is non-standard and only available on some servers.
Additionally, paths containing spaces are not supported because the FTP
protocol has no standard quoting mechanism for `SITE` command arguments.
- **Hard Links**: Hard links are not supported by the FTP protocol.
## Related Crates
- [fuseftp-cli](https://crates.io/crates/fuseftp-cli) - Command-line interface
- [fuseftp-mount-helper](https://crates.io/crates/fuseftp-mount-helper) - mount(8) integration
## License
MIT or Apache-2.0