#[cfg(not(target_os = "redox"))]
libc_bitflags!( /// File system mount Flags #[derive(Default)] pubstruct FsFlags: c_ulong { /// Read Only #[cfg(not(target_os = "haiku"))]
ST_RDONLY; /// Do not allow the set-uid bits to have an effect #[cfg(not(target_os = "haiku"))]
ST_NOSUID; /// Do not interpret character or block-special devices #[cfg(linux_android)]
ST_NODEV; /// Do not allow execution of binaries on the filesystem #[cfg(linux_android)]
ST_NOEXEC; /// All IO should be done synchronously #[cfg(linux_android)]
ST_SYNCHRONOUS; /// Allow mandatory locks on the filesystem #[cfg(linux_android)]
ST_MANDLOCK; /// Write on file/directory/symlink #[cfg(target_os = "linux")]
ST_WRITE; /// Append-only file #[cfg(target_os = "linux")]
ST_APPEND; /// Immutable file #[cfg(target_os = "linux")]
ST_IMMUTABLE; /// Do not update access times on files #[cfg(linux_android)]
ST_NOATIME; /// Do not update access times on files #[cfg(linux_android)]
ST_NODIRATIME; /// Update access time relative to modify/change time #[cfg(any(target_os = "android", all(target_os = "linux", not(target_env = "musl"), not(target_env = "ohos"))))]
ST_RELATIME;
}
);
impl Statvfs { /// get the file system block size pubfn block_size(&self) -> c_ulong { self.0.f_bsize
}
/// Get the fundamental file system block size pubfn fragment_size(&self) -> c_ulong { self.0.f_frsize
}
/// Get the number of blocks. /// /// Units are in units of `fragment_size()` pubfn blocks(&self) -> libc::fsblkcnt_t { self.0.f_blocks
}
/// Get the number of free blocks in the file system pubfn blocks_free(&self) -> libc::fsblkcnt_t { self.0.f_bfree
}
/// Get the number of free blocks for unprivileged users pubfn blocks_available(&self) -> libc::fsblkcnt_t { self.0.f_bavail
}
/// Get the total number of file inodes pubfn files(&self) -> libc::fsfilcnt_t { self.0.f_files
}
/// Get the number of free file inodes pubfn files_free(&self) -> libc::fsfilcnt_t { self.0.f_ffree
}
/// Get the number of free file inodes for unprivileged users pubfn files_available(&self) -> libc::fsfilcnt_t { self.0.f_favail
}
/// Get the file system id #[cfg(not(target_os = "hurd"))] pubfn filesystem_id(&self) -> c_ulong { self.0.f_fsid
} /// Get the file system id #[cfg(target_os = "hurd")] pubfn filesystem_id(&self) -> u64 { self.0.f_fsid
}
/// Get the mount flags #[cfg(not(target_os = "redox"))] pubfn flags(&self) -> FsFlags {
FsFlags::from_bits_truncate(self.0.f_flag)
}
/// Get the maximum filename length pubfn name_max(&self) -> c_ulong { self.0.f_namemax
}
}
/// Return a `Statvfs` object with information about the `path` pubfn statvfs<P: ?Sized + NixPath>(path: &P) -> Result<Statvfs> { unsafe {
Errno::clear(); letmut stat = mem::MaybeUninit::<libc::statvfs>::uninit(); let res = path.with_nix_path(|path| {
libc::statvfs(path.as_ptr(), stat.as_mut_ptr())
})?;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.