#fs-file #future #file #async #file-io

fs

A Futures implementation for File System operations

1 unstable release

Uses old Rust 2015

0.0.5 Jun 7, 2019

#49 in #fs-file

Download history 300/week @ 2024-03-13 405/week @ 2024-03-20 407/week @ 2024-03-27 385/week @ 2024-04-03 339/week @ 2024-04-10 365/week @ 2024-04-17 380/week @ 2024-04-24 337/week @ 2024-05-01 359/week @ 2024-05-08 389/week @ 2024-05-15 354/week @ 2024-05-22 400/week @ 2024-05-29 373/week @ 2024-06-05 334/week @ 2024-06-12 340/week @ 2024-06-19 359/week @ 2024-06-26

1,466 downloads per month
Used in 17 crates (6 directly)

MIT/Apache

18KB
387 lines

fs

Travis Build Status crates.io docs.rs

Re-published from [futures-fs](https://github.com/seanmonstar/futures-fs), access File System operations off-thread, using Futures and Streams.

Usage

let fs = FsPool::default();

// our source file
let read = fs.read("/home/sean/foo.txt", Default::default());

// default writes options to create a new file
let write = fs.write("/home/sean/out.txt", Default::default());

// block this thread!
// the reading and writing however will happen off-thread
read.forward(write).wait()
    .expect("IO error piping foo.txt to out.txt");

lib.rs:

A thread pool to handle file IO operations.

Examples

extern crate futures;
extern crate futures_fs;

use futures::{Future, Stream};
use futures_fs::FsPool;

let fs = FsPool::default();

// our source file
let read = fs.read("/home/sean/foo.txt", Default::default());

// default writes options to create a new file
let write = fs.write("/home/sean/out.txt", Default::default());

// block this thread!
// the reading and writing however will happen off-thread
read.forward(write).wait()
    .expect("IO error piping foo.txt to out.txt");

Dependencies

~490KB