Skip to content

Safe wrapper over mkstemp function written in Rust

Notifications You must be signed in to change notification settings

ancwrd1/mkstemp.rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mkstemp.rs

Safe wrapper over mkstemp function from libc (Unix systems only).

You should probably use a (much) better crate like tempfile.

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)

About

Safe wrapper over mkstemp function written in Rust

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages