Trait UnixFileSystem

Source
pub trait UnixFileSystem {
    // Required methods
    fn mode<P: AsRef<Path>>(&self, path: P) -> Result<u32>;
    fn set_mode<P: AsRef<Path>>(&self, path: P, mode: u32) -> Result<()>;
    fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(
        &self,
        src: P,
        dst: Q,
    ) -> Result<()>;
    fn get_symlink_src<P: AsRef<Path>>(&self, dst: P) -> Result<PathBuf>;
}

Required Methods§

Source

fn mode<P: AsRef<Path>>(&self, path: P) -> Result<u32>

Returns the current mode bits of path.

§Errors
  • path does not exist.
  • Current user has insufficient permissions.
Source

fn set_mode<P: AsRef<Path>>(&self, path: P, mode: u32) -> Result<()>

Sets the mode bits of path.

§Errors
  • path does not exist.
  • Current user has insufficient permissions.

Creates a new symbolic link on the filesystem.

The dst path will be a symbolic link pointing to the src path.

Based on std::os::unix::fs::symlink.

Gets the source for a symlink.

Based on std::fs::read_link

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§