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
@@ -15,9 +15,10 @@ native mod libc = "libc.so.6" {
|
||||
fn ungetc(int c, FILE f);
|
||||
|
||||
type dir;
|
||||
// readdir is a mess; handle via wrapper function in rustrt.
|
||||
fn opendir(sbuf d) -> dir;
|
||||
fn closedir(dir d) -> int;
|
||||
type dirent;
|
||||
fn readdir(dir d) -> dirent;
|
||||
|
||||
fn getenv(sbuf n) -> sbuf;
|
||||
fn setenv(sbuf n, sbuf v, int overwrite) -> int;
|
||||
@@ -39,10 +40,6 @@ mod libc_constants {
|
||||
fn S_IWUSR() -> uint { ret 0x0080u; }
|
||||
}
|
||||
|
||||
fn path_sep() -> str {
|
||||
ret "/";
|
||||
}
|
||||
|
||||
fn exec_suffix() -> str {
|
||||
ret "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user