No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2017-11-29 21:13:55 -07:00
src Add Redox OS backend (#32) 2017-08-14 18:23:50 -07:00
tests rustfmt 2017-01-19 13:19:04 -08:00
.gitignore Works on linux. 2015-04-11 21:54:16 -04:00
.travis.yml Document/test minimum rust version. 2017-02-25 13:10:27 -08:00
appveyor.yml Document/test minimum rust version. 2017-02-25 13:10:27 -08:00
Cargo.toml Release 2.2.0 2017-09-26 09:33:29 +03:00
LICENSE-APACHE Add license and readme. 2015-04-14 00:36:11 -04:00
LICENSE-MIT Add license and readme. 2015-04-14 00:36:11 -04:00
NEWS Retractivly update the changelog. 2016-10-01 18:03:52 -07:00
README.md Document/test minimum rust version. 2017-02-25 13:10:27 -08:00
rustfmt.toml Add rustfmt config 2016-01-18 23:14:06 -05:00

tempfile

Minimum Rust Version: 1.9.0

Linux: Build Status Windows: Build status

A secure cross-platform temporary file library for rust. In addition to creating temporary files, this library also allows users to securely open multiple independent references to the same temporary file (useful for consumer/producer patterns and surprisingly difficult to implement securely).

Example

extern crate tempfile;
use std::fs::File;
use std::io::{Write, Read, Seek, SeekFrom};

fn main() {
    // Write
    let mut tmpfile: File = tempfile::tempfile().unwrap();
    write!(tmpfile, "Hello World!").unwrap();

    // Seek to start
    tmpfile.seek(SeekFrom::Start(0)).unwrap();

    // Read
    let mut buf = String::new();
    tmpfile.read_to_string(&mut buf).unwrap();
    assert_eq!("Hello World!", buf);
}

Documentation

https://stebalien.github.com/tempfile/tempfile/