diff options
| author | Elly Jones <elly@leptoquark.net> | 2011-12-16 17:32:09 -0500 |
|---|---|---|
| committer | Elly Jones <elly@leptoquark.net> | 2011-12-16 17:37:21 -0500 |
| commit | 89e880d613bc797b3867f91cd7f676c9b4737397 (patch) | |
| tree | 1bdaa03dc685a13b84ff2954767f771e86bb8f21 /src/libstd | |
| parent | b11268780ed7961c710d6a66665b82a2e5019a08 (diff) | |
| download | rust-89e880d613bc797b3867f91cd7f676c9b4737397.tar.gz rust-89e880d613bc797b3867f91cd7f676c9b4737397.zip | |
std: file_is_dir -> path_is_dir, add path_exists
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/fs.rs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index eac2347748e..46dad7b2bbb 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -12,7 +12,8 @@ import os_fs; #[abi = "cdecl"] native mod rustrt { - fn rust_file_is_dir(path: str::sbuf) -> int; + fn rust_path_is_dir(path: str::sbuf) -> int; + fn rust_path_exists(path: str::sbuf) -> int; } /* @@ -110,12 +111,21 @@ fn connect_many(paths: [path]) : vec::is_not_empty(paths) -> path { } /* -Function: file_id_dir +Function: path_is_dir Indicates whether a path represents a directory. */ -fn file_is_dir(p: path) -> bool { - ret str::as_buf(p, {|buf| rustrt::rust_file_is_dir(buf) != 0 }); +fn path_is_dir(p: path) -> bool { + ret str::as_buf(p, {|buf| rustrt::rust_path_is_dir(buf) != 0 }); +} + +/* +Function: path_exists + +Indicates whether a path exists. +*/ +fn path_exists(p: path) -> bool { + ret str::as_buf(p, {|buf| rustrt::rust_path_exists(buf) != 0 }); } /* |
