#default #fill

cavity

Create files padded with zeros. Alternatinve to macOS's mkfile.

2 stable releases

Uses old Rust 2015

1.1.0 Nov 10, 2017
1.0.0 Nov 10, 2017

#1550 in Filesystem

Download history 25/week @ 2023-06-02 3/week @ 2023-06-09 52/week @ 2023-06-16 19/week @ 2023-06-23 18/week @ 2023-06-30 23/week @ 2023-07-07 8/week @ 2023-07-14 17/week @ 2023-07-21 14/week @ 2023-07-28 20/week @ 2023-08-04 10/week @ 2023-08-11 12/week @ 2023-08-18 41/week @ 2023-08-25 15/week @ 2023-09-01 22/week @ 2023-09-08 12/week @ 2023-09-15

92 downloads per month
Used in 2 crates

BSD-2-Clause

6KB
68 lines

Crates.io

Cavity

Very small library to create files. It's an alternative to macOS's mkfile(8) that works on everything that has rust's std. Unlike mkfile this uses configurable chunksize and has default of 512Kb.

Installation

cavity is available on crates.io and can be included in your Cargo enabled project like this:

[dependencies]
cavity = "1.1.0"

Example

Read the "docs".

use cavity::{fill, Bytes, WriteMode};
use std::fs::File;
let mut f = File::create("wat.test").unwrap();
fill(Bytes::MegaBytes(5), None, WriteMode::FlushEvery, &mut f).unwrap();

No runtime deps