unix 0.6.12

Interface to Unix system facilities
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
extern crate io;
#[macro_use]
extern crate null_terminated;
extern crate unix;

use io::Write;
use unix::{File, dir::Dir};

fn main() {
    let mut d = Dir::new_boxed(::unix::file::open_at(None, str0!("."), ::unix::file::OpenMode::RdOnly, None).unwrap(), 2048).unwrap();
    let mut f = File::new_unchecked(1);
    while let Some(entry) = d.next_entry() {
        f.writev(&[&entry.name, "\n".as_bytes()]).unwrap();
    }
}