diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-10-29 23:31:07 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-11-03 15:15:42 -0800 |
| commit | f19d0833625c382c5d0a8868924cd4620335e659 (patch) | |
| tree | 9d4d67c3f845aa4f2596c6db94f9c883ab1dd696 /src/libstd/libc.rs | |
| parent | 9c1851019f1ef9511fa8731b8f1acb0796d1e97f (diff) | |
Fill out the remaining functionality in io::file
This adds bindings to the remaining functions provided by libuv, all of which are useful operations on files which need to get exposed somehow. Some highlights: * Dropped `FileReader` and `FileWriter` and `FileStream` for one `File` type * Moved all file-related methods to be static methods under `File` * All directory related methods are still top-level functions * Created `io::FilePermission` types (backed by u32) that are what you'd expect * Created `io::FileType` and refactored `FileStat` to use FileType and FilePermission * Removed the expanding matrix of `FileMode` operations. The mode of reading a file will not have the O_CREAT flag, but a write mode will always have the O_CREAT flag. Closes #10130 Closes #10131 Closes #10121
Diffstat (limited to 'src/libstd/libc.rs')
| -rw-r--r-- | src/libstd/libc.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstd/libc.rs b/src/libstd/libc.rs index d4df0e826f6..f992b327495 100644 --- a/src/libstd/libc.rs +++ b/src/libstd/libc.rs @@ -142,7 +142,7 @@ pub use libc::consts::os::c95::{SEEK_SET, TMP_MAX}; pub use libc::consts::os::posix88::{F_OK, O_APPEND, O_CREAT, O_EXCL}; pub use libc::consts::os::posix88::{O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY}; pub use libc::consts::os::posix88::{R_OK, S_IEXEC, S_IFBLK, S_IFCHR}; -pub use libc::consts::os::posix88::{S_IFDIR, S_IFIFO, S_IFMT, S_IFREG}; +pub use libc::consts::os::posix88::{S_IFDIR, S_IFIFO, S_IFMT, S_IFREG, S_IFLNK}; pub use libc::consts::os::posix88::{S_IREAD, S_IRUSR, S_IRWXU, S_IWUSR}; pub use libc::consts::os::posix88::{STDERR_FILENO, STDIN_FILENO}; pub use libc::consts::os::posix88::{STDOUT_FILENO, W_OK, X_OK}; @@ -1168,6 +1168,7 @@ pub mod consts { pub static S_IFBLK : c_int = 12288; pub static S_IFDIR : c_int = 16384; pub static S_IFREG : c_int = 32768; + pub static S_IFLNK : c_int = 40960; pub static S_IFMT : c_int = 61440; pub static S_IEXEC : c_int = 64; pub static S_IWRITE : c_int = 128; @@ -1345,6 +1346,7 @@ pub mod consts { pub static S_IFBLK : c_int = 24576; pub static S_IFDIR : c_int = 16384; pub static S_IFREG : c_int = 32768; + pub static S_IFLNK : c_int = 40960; pub static S_IFMT : c_int = 61440; pub static S_IEXEC : c_int = 64; pub static S_IWRITE : c_int = 128; @@ -1555,6 +1557,7 @@ pub mod consts { pub static S_IFBLK : c_int = 24576; pub static S_IFDIR : c_int = 16384; pub static S_IFREG : c_int = 32768; + pub static S_IFLNK : c_int = 40960; pub static S_IFMT : c_int = 61440; pub static S_IEXEC : c_int = 64; pub static S_IWRITE : c_int = 128; @@ -1999,6 +2002,7 @@ pub mod consts { pub static S_IFBLK : c_int = 24576; pub static S_IFDIR : c_int = 16384; pub static S_IFREG : c_int = 32768; + pub static S_IFLNK : c_int = 40960; pub static S_IFMT : c_int = 61440; pub static S_IEXEC : c_int = 64; pub static S_IWRITE : c_int = 128; @@ -2341,6 +2345,7 @@ pub mod consts { pub static S_IFBLK : c_int = 24576; pub static S_IFDIR : c_int = 16384; pub static S_IFREG : c_int = 32768; + pub static S_IFLNK : c_int = 40960; pub static S_IFMT : c_int = 61440; pub static S_IEXEC : c_int = 64; pub static S_IWRITE : c_int = 128; |
