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:
committed by
Graydon Hoare
parent
3436979b17
commit
c731d625fe
10
src/lib/win32_fs.rs
Normal file
10
src/lib/win32_fs.rs
Normal 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 = '\\';
|
||||
Reference in New Issue
Block a user