Struct libracerd::util::fs::TmpFile [] [src]

pub struct TmpFile {
    // some fields omitted
}

A temporary file that is removed on drop

With the new constructor, you provide contents and a file is created based on the name of the current task. The with_name constructor allows you to choose a name. Neither forms are secure, and both are subject to race conditions.

Methods

impl TmpFile

fn new(contents: &str) -> TmpFile

Create a temp file with random name and contents.

fn with_name(name: &str, contents: &str) -> TmpFile

Create a file with name and contents.

fn path<'a>(&'a self) -> &'a Path

Get the Path of the TmpFile

Trait Implementations

impl Drop for TmpFile

fn drop(&mut self)