|
@@ -38,41 +38,41 @@ bitflags! {
|
|
|
pub struct FileMode: u32{
|
|
|
/* File access modes for `open' and `fcntl'. */
|
|
|
/// Open Read-only
|
|
|
- const O_RDONLY = 0;
|
|
|
+ const O_RDONLY = 0o0;
|
|
|
/// Open Write-only
|
|
|
- const O_WRONLY = 1;
|
|
|
+ const O_WRONLY = 0o1;
|
|
|
/// Open read/write
|
|
|
- const O_RDWR = 2;
|
|
|
+ const O_RDWR = 0o2;
|
|
|
/// Mask for file access modes
|
|
|
- const O_ACCMODE = 00000003;
|
|
|
+ const O_ACCMODE = 0o00000003;
|
|
|
|
|
|
/* Bits OR'd into the second argument to open. */
|
|
|
/// Create file if it does not exist
|
|
|
- const O_CREAT = 00000100;
|
|
|
+ const O_CREAT = 0o00000100;
|
|
|
/// Fail if file already exists
|
|
|
- const O_EXCL = 00000200;
|
|
|
+ const O_EXCL = 0o00000200;
|
|
|
/// Do not assign controlling terminal
|
|
|
- const O_NOCTTY = 00000400;
|
|
|
+ const O_NOCTTY = 0o00000400;
|
|
|
/// 文件存在且是普通文件,并以O_RDWR或O_WRONLY打开,则它会被清空
|
|
|
- const O_TRUNC = 00001000;
|
|
|
+ const O_TRUNC = 0o00001000;
|
|
|
/// 文件指针会被移动到文件末尾
|
|
|
- const O_APPEND = 00002000;
|
|
|
+ const O_APPEND = 0o00002000;
|
|
|
/// 非阻塞式IO模式
|
|
|
- const O_NONBLOCK = 00004000;
|
|
|
+ const O_NONBLOCK = 0o00004000;
|
|
|
/// used to be O_SYNC, see below
|
|
|
- const O_DSYNC = 00010000;
|
|
|
+ const O_DSYNC = 0o00010000;
|
|
|
/// fcntl, for BSD compatibility
|
|
|
- const FASYNC = 00020000;
|
|
|
+ const FASYNC = 0o00020000;
|
|
|
/* direct disk access hint */
|
|
|
- const O_DIRECT = 00040000;
|
|
|
- const O_LARGEFILE = 00100000;
|
|
|
+ const O_DIRECT = 0o00040000;
|
|
|
+ const O_LARGEFILE = 0o00100000;
|
|
|
/// 打开的必须是一个目录
|
|
|
- const O_DIRECTORY = 00200000;
|
|
|
+ const O_DIRECTORY = 0o00200000;
|
|
|
/// Do not follow symbolic links
|
|
|
- const O_NOFOLLOW = 00400000;
|
|
|
- const O_NOATIME = 01000000;
|
|
|
+ const O_NOFOLLOW = 0o00400000;
|
|
|
+ const O_NOATIME = 0o01000000;
|
|
|
/// set close_on_exec
|
|
|
- const O_CLOEXEC = 02000000;
|
|
|
+ const O_CLOEXEC = 0o02000000;
|
|
|
}
|
|
|
}
|
|
|
|