Add basic file-system functionality

std.fs.list_dir will list the files in a directory, std.fs.file_is_dir
will, given a pathname, determine whether it is a directory or not.
This commit is contained in:
Marijn Haverbeke
2011-03-10 15:56:51 +01:00
committed by Graydon Hoare
parent 3436979b17
commit c731d625fe
15 changed files with 146 additions and 61 deletions

10
src/lib/win32_fs.rs Normal file
View File

@@ -0,0 +1,10 @@
native "rust" mod rustrt {
fn rust_list_files(str path) -> vec[str];
fn rust_file_is_dir(str path) -> int;
}
impure fn list_dir(str path) -> vec[str] {
ret rustrt.rust_list_files(path+"*");
}
const char path_sep = '\\';