#future #fs-file #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

#1670 in Filesystem

Download history 381/week @ 2024-07-20 378/week @ 2024-07-27 296/week @ 2024-08-03 444/week @ 2024-08-10 367/week @ 2024-08-17 385/week @ 2024-08-24 404/week @ 2024-08-31 347/week @ 2024-09-07 375/week @ 2024-09-14 366/week @ 2024-09-21 326/week @ 2024-09-28 174/week @ 2024-10-05 303/week @ 2024-10-12 328/week @ 2024-10-19 355/week @ 2024-10-26 317/week @ 2024-11-02

1,332 downloads per month
Used in 19 crates (8 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

~505KB