tar 0.2.3

A Rust implementation of a TAR file reader and writer. This library does not currently handle compression, but it is abstract over all I/O readers and writers. Additionally, great lengths are taken to ensure that the entire contents are never required to be entirely resident in memory all at once.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::old_io;
use std::io;
use std::path;

pub struct TempDir {
    inner: old_io::TempDir,
}

impl TempDir {
    pub fn new(prefix: &str) -> io::Result<TempDir> {
        Ok(TempDir { inner: old_io::TempDir::new(prefix).unwrap() })
    }

    pub fn path(&self) -> &path::Path {
        path::Path::new(self.inner.path().as_str().unwrap())
    }
}