Skip to main content

Module fs

Module fs 

Source
Expand description

File and file system access

Re-exportsΒ§

use std::borrow::Cow; πŸ”’
use std::ffi::OsString; πŸ”’
use std::fs; πŸ”’
use std::fs::DirBuilder; πŸ”’
use std::fs::File; πŸ”’
use std::fs::FileTimes; πŸ”’
use std::fs::OpenOptions; πŸ”’
use std::fs::TryLockError; πŸ”’
use std::io; πŸ”’
use std::io::ErrorKind; πŸ”’
use std::io::Read; πŸ”’
use std::io::Seek; πŸ”’
use std::io::SeekFrom; πŸ”’
use std::io::Write; πŸ”’
use std::path; πŸ”’
use std::path::Path; πŸ”’
use std::time::SystemTime; πŸ”’
use rand::RngExt; πŸ”’
use rustc_abi::Size; πŸ”’
use rustc_data_structures::either::Either; πŸ”’
use rustc_data_structures::fx::FxHashMap; πŸ”’
use rustc_target::spec::Os; πŸ”’
use self::shims::time::system_time_to_duration; πŸ”’
use crate::shims::files::BIG_ACCESS; πŸ”’
use crate::shims::files::DirHandle; πŸ”’
use crate::shims::files::DynFileDescriptionRef; πŸ”’
use crate::shims::files::EvalContextExt as _; πŸ”’
use crate::shims::files::FdNum; πŸ”’
use crate::shims::files::FileHandle; πŸ”’
use crate::shims::files::open_file_or_dir; πŸ”’
use crate::shims::os_str::PathConversion; πŸ”’
use crate::shims::os_str::bytes_to_os_str; πŸ”’
use crate::shims::sig::Varargs; πŸ”’
use crate::shims::unix::fd::EvalContextExt as _; πŸ”’
use crate::shims::unix::fd::FlockOp; πŸ”’
use crate::shims::unix::fd::UnixFileDescription; πŸ”’
use crate::shims::FdId; πŸ”’
use crate::shims::FileDescription; πŸ”’
use crate::*; πŸ”’

StructsΒ§

DirEntry πŸ”’
DirStream πŸ”’
An open directory stream (DIR), tracked by DirTable.
DirTable
The table of open directories. Curiously, Unix/POSIX does not unify this into the β€œfile descriptor” concept… everything is a file, except a directory is not?
FileMetadata πŸ”’
Stores a file’s metadata in order to avoid code duplication in the different metadata related shims.

EnumsΒ§

TimeUpdate πŸ”’
What a futimens timespec asks for: leave the timestamp alone (UTIME_OMIT) or set it.

TraitsΒ§

EvalContextExt
EvalContextExtPrivate πŸ”’

FunctionsΒ§

extract_sec_and_nsec πŸ”’
Extracts the number of seconds and nanoseconds elapsed between time and the unix epoch when time is Ok. Returns None if time is an error. Fails if time happens before the unix epoch.
file_type_to_mode_name πŸ”’
host_file_times_from_updates πŸ”’
The host FileTimes that applies the given access and modification time updates.
maybe_sync_file πŸ”’
same_host_file πŸ”’