#temporary #temporary-files

mkstemp-rs

Safe wrapper over mkstemp function from libc

3 releases (1 stable)

Uses old Rust 2015

1.0.0 Dec 30, 2017
0.0.2 Dec 31, 2016
0.0.1 Dec 30, 2016

#1635 in Filesystem

Download history 30/week @ 2024-07-20 64/week @ 2024-07-27 16/week @ 2024-08-03 6/week @ 2024-08-10 24/week @ 2024-08-17 5/week @ 2024-08-24 7/week @ 2024-08-31 24/week @ 2024-09-07 11/week @ 2024-09-14 47/week @ 2024-09-21 13/week @ 2024-09-28 9/week @ 2024-10-05 17/week @ 2024-10-12 11/week @ 2024-10-19 17/week @ 2024-10-26 28/week @ 2024-11-02

74 downloads per month

MIT license

5KB
69 lines

mkstemp.rs

Safe wrapper over mkstemp function from libc

Documentation

Usage example:

use std::io::Write;
extern crate mkstemp;
pub fn main() {
    // delete automatically when it goes out of scope
    let mut temp_file = mkstemp::TempFile::new("/tmp/testXXXXXX", true).unwrap();
     temp_file.write("test content".as_bytes()).unwrap();
}

License

Licensed under MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)


lib.rs:

Safe wrapper over mkstemp function from libc

Usage example:

use std::io::Write;
extern crate mkstemp;
pub fn main() {
    // delete automatically when it goes out of scope
    let mut temp_file = mkstemp::TempFile::new("/tmp/testXXXXXX", true).unwrap();
    temp_file.write("test content".as_bytes()).unwrap();
}

Dependencies

~44KB