[][src]Module unix::file

File and filesystem operations

Many functions here which take a path also take an opt_dir argument of type Option<&File>. If the path is relative, it is interpreted relative to opt_dir if it is Some, else the current working directory. Such functions are marked with an _at suffix.

Re-exports

pub use self::new_pipe as mk_pipe;
pub use self::Clobber::*;
pub use self::Mode as FileMode;
pub use self::ModeSection::*;
pub use self::ModeSection as FileModeSection;

Structs

AtFlags

Flags modifying behavior of file operations

File

File descriptor, closed on drop

FilePermission
Mode

File mode

OpenFlags

File creation and status flags

OpenMode

Whether to open a file for reading or writing

Permission
Stat

File information

Enums

Clobber

Specify what to do if there is already a file at path.

ModeSection

Which agent has the permissions

Constants

O_CLOEXEC
O_EXCL
O_NOCTTY
O_NONBLOCK

Functions

atomic_write_file_at

Atomically write the file at the given path:

chmod_at

Change the mode of the file at path.

exec_at

Execute the program file at path.

link_at

Link the file from old_path to new_path.

mktemp_at

Generate a unique temporary file name in templ, and create and open a file there.

new_pipe

Return the ends (rx, tx) of a new pipe. Data written to tx can be read from rx.

open_at

Open the file at the given path, creating it if f_mode is Some and it isn't already there.

rename_at

Rename the file from old_path to new_path.

stat_at

Return information about the file at path.

unlink_at

Unlink the file at path.