std::os::unix::fs
API 参考只有英文版,由标准库源代码中的英文文档注释生成。
the Unix side of the cross-platform fs types:
permission bits, the open functions' os records, and
openat(2) itself with its O_* flags.
Structs
OsOpenFlagsSource
pub struct OsOpenFlagsUnix knobs of Dir::open / File::open (OpenFlags.os).
More
O_*flags for open(2):O_NOATIME,O_DIRECT,O_SYNC,O_NONBLOCK, ... The bits the open function decides (access,O_CREAT,O_EXCL,O_TRUNC,O_APPEND,O_DIRECTORY,O_NOFOLLOW) areInvalidInput.
OsCreateFlagsSource
pub struct OsCreateFlagsUnix knobs of the functions that may create the file
(CreateFlags.os); the create mode is CreateFlags.permissions.
As
OsOpenFlags.custom_flags.
Traits
PermissionsExtSource
pub trait PermissionsExtThe Unix permission bits of a Permissions.
Permissions with bits
mode(0o644; bits past0o7777are dropped).The permission bits.
Set the bits to
mode(asfrom_mode).
DirExtSource
pub trait DirExtopen(2) as the OS has it, for what the typed functions leave out
(truncating an existing file only, O_TMPFILE, O_PATH, ...).
Constants
O_RDONLYSource
pub const O_RDONLY: i32 = 0Open for reading only.
O_WRONLYSource
pub const O_WRONLY: i32 = 1Open for writing only.
O_RDWRSource
pub const O_RDWR: i32 = 2Open for reading and writing.
O_ACCMODESource
pub const O_ACCMODE: i32 = 3The mask of the access mode bits.
O_CREATSource
pub const O_CREAT: i32 = 0x40Create the file when missing.
O_EXCLSource
pub const O_EXCL: i32 = 0x80With O_CREAT, fail when the file exists.
O_NOCTTYSource
pub const O_NOCTTY: i32 = 0x100Do not make a terminal the controlling one.
O_TRUNCSource
pub const O_TRUNC: i32 = 0x200Empty the file on open.
O_APPENDSource
pub const O_APPEND: i32 = 0x400Every write goes to the end.
O_NONBLOCKSource
pub const O_NONBLOCK: i32 = 0x800Non-blocking open and I/O.
O_DSYNCSource
pub const O_DSYNC: i32 = 0x1000Writes wait for the data to reach the device.
O_SYNCSource
pub const O_SYNC: i32 = 0x101000Writes wait for data and metadata to reach the device.
O_NOATIMESource
pub const O_NOATIME: i32 = 0x40000Do not update the access time.
O_CLOEXECSource
pub const O_CLOEXEC: i32 = 0x80000Close the descriptor on exec.
O_PATHSource
pub const O_PATH: i32 = 0x200000A descriptor for the path only, no I/O.
O_TMPFILESource
pub const O_TMPFILE: i32 = 0x400000 | O_DIRECTORYAn unnamed temporary file in the directory given.
O_DIRECTORYSource
pub const O_DIRECTORY: i32 = 0x4000Fail unless the path is a directory.
O_NOFOLLOWSource
pub const O_NOFOLLOW: i32 = 0x8000Fail when the last component is a symbolic link.
O_DIRECTSource
pub const O_DIRECT: i32 = 0x10000Bypass the page cache.
O_DIRECTSource
pub const O_DIRECT: i32 = 0x20000Bypass the page cache.
O_DIRECTORYSource
pub const O_DIRECTORY: i32 = 0x10000Fail unless the path is a directory.
O_NOFOLLOWSource
pub const O_NOFOLLOW: i32 = 0x20000Fail when the last component is a symbolic link.
O_DIRECTSource
pub const O_DIRECT: i32 = 0x4000Bypass the page cache.
O_NONBLOCKSource
pub const O_NONBLOCK: i32 = 0x4Non-blocking open and I/O.
O_APPENDSource
pub const O_APPEND: i32 = 0x8Every write goes to the end.
O_SYNCSource
pub const O_SYNC: i32 = 0x80Writes wait for data and metadata to reach the device.
O_NOFOLLOWSource
pub const O_NOFOLLOW: i32 = 0x100Fail when the last component is a symbolic link.
O_CREATSource
pub const O_CREAT: i32 = 0x200Create the file when missing.
O_TRUNCSource
pub const O_TRUNC: i32 = 0x400Empty the file on open.
O_EXCLSource
pub const O_EXCL: i32 = 0x800With O_CREAT, fail when the file exists.
O_NOCTTYSource
pub const O_NOCTTY: i32 = 0x20000Do not make a terminal the controlling one.
O_DIRECTORYSource
pub const O_DIRECTORY: i32 = 0x100000Fail unless the path is a directory.
O_DSYNCSource
pub const O_DSYNC: i32 = 0x400000Writes wait for the data to reach the device.
O_CLOEXECSource
pub const O_CLOEXEC: i32 = 0x1000000Close the descriptor on exec.
O_NOCTTYSource
pub const O_NOCTTY: i32 = 0x8000Do not make a terminal the controlling one.
O_DIRECTSource
pub const O_DIRECT: i32 = 0x10000Bypass the page cache.
O_DIRECTORYSource
pub const O_DIRECTORY: i32 = 0x20000Fail unless the path is a directory.
O_CLOEXECSource
pub const O_CLOEXEC: i32 = 0x100000Close the descriptor on exec.
O_PATHSource
pub const O_PATH: i32 = 0x400000A descriptor for the path only, no I/O.
O_DSYNCSource
pub const O_DSYNC: i32 = 0x1000000Writes wait for the data to reach the device.