Trait cap_fs_ext::DirExt [−][src]
Extension trait for Dir
.
Required methods
fn set_atime<P: AsRef<Path>>(
&self,
path: P,
atime: SystemTimeSpec
) -> Result<()>
[src]
&self,
path: P,
atime: SystemTimeSpec
) -> Result<()>
Set the last access time for a file on a filesystem.
This corresponds to filetime::set_file_atime
.
fn set_mtime<P: AsRef<Path>>(
&self,
path: P,
mtime: SystemTimeSpec
) -> Result<()>
[src]
&self,
path: P,
mtime: SystemTimeSpec
) -> Result<()>
Set the last modification time for a file on a filesystem.
This corresponds to filetime::set_file_mtime
.
fn set_times<P: AsRef<Path>>(
&self,
path: P,
atime: Option<SystemTimeSpec>,
mtime: Option<SystemTimeSpec>
) -> Result<()>
[src]
&self,
path: P,
atime: Option<SystemTimeSpec>,
mtime: Option<SystemTimeSpec>
) -> Result<()>
Set the last access and modification times for a file on a filesystem.
This corresponds to filetime::set_file_times
.
fn set_symlink_times<P: AsRef<Path>>(
&self,
path: P,
atime: Option<SystemTimeSpec>,
mtime: Option<SystemTimeSpec>
) -> Result<()>
[src]
&self,
path: P,
atime: Option<SystemTimeSpec>,
mtime: Option<SystemTimeSpec>
) -> Result<()>
Set the last access and modification times for a file on a filesystem. This function does not follow symlink.
This corresponds to filetime::set_symlink_file_times
.
fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(&self, src: P, dst: Q) -> Result<()>
[src]
Creates a new symbolic link on a filesystem.
This corresponds to std::os::unix::fs::symlink
, except that it's
supported on non-Unix platforms as well, and it's not guaranteed to be
atomic.
fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(
&self,
src: P,
dst: Q
) -> Result<()>
[src]
&self,
src: P,
dst: Q
) -> Result<()>
Creates a new file symbolic link on a filesystem.
This corresponds to std::os::windows::fs::symlink_file
, except that
it's supported on non-Windows platforms as well, and it's not
guaranteed to fail if the target is not a file.
fn symlink_dir<P: AsRef<Path>, Q: AsRef<Path>>(
&self,
src: P,
dst: Q
) -> Result<()>
[src]
&self,
src: P,
dst: Q
) -> Result<()>
Creates a new directory symbolic link on a filesystem.
This corresponds to std::os::windows::fs::symlink_dir
, except that
it's supported on non-Windows platforms as well, and it's not
guaranteed to fail if the target is not a directory.
fn open_dir_nofollow<P: AsRef<Path>>(&self, path: P) -> Result<Self> where
Self: Sized,
[src]
Self: Sized,
Similar to cap_std::fs::Dir::open_dir
, but fails if the path names a
symlink.
fn remove_file_or_symlink<P: AsRef<Path>>(&self, path: P) -> Result<()>
[src]
Removes a file or symlink from a filesystem.
Removal of symlinks has different behavior under Windows - if a symlink
points to a directory, it cannot be removed with the remove_file
operation. This method will remove files and all symlinks.
On Windows, if a file or symlink does not exist at this path, but an empty directory does exist, this function will remove the directory.
Implementations on Foreign Types
impl DirExt for Dir
[src]
fn set_atime<P: AsRef<Path>>(
&self,
path: P,
atime: SystemTimeSpec
) -> Result<()>
[src]
&self,
path: P,
atime: SystemTimeSpec
) -> Result<()>
fn set_mtime<P: AsRef<Path>>(
&self,
path: P,
mtime: SystemTimeSpec
) -> Result<()>
[src]
&self,
path: P,
mtime: SystemTimeSpec
) -> Result<()>
fn set_times<P: AsRef<Path>>(
&self,
path: P,
atime: Option<SystemTimeSpec>,
mtime: Option<SystemTimeSpec>
) -> Result<()>
[src]
&self,
path: P,
atime: Option<SystemTimeSpec>,
mtime: Option<SystemTimeSpec>
) -> Result<()>
fn set_symlink_times<P: AsRef<Path>>(
&self,
path: P,
atime: Option<SystemTimeSpec>,
mtime: Option<SystemTimeSpec>
) -> Result<()>
[src]
&self,
path: P,
atime: Option<SystemTimeSpec>,
mtime: Option<SystemTimeSpec>
) -> Result<()>
fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(&self, src: P, dst: Q) -> Result<()>
[src]
fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(
&self,
src: P,
dst: Q
) -> Result<()>
[src]
&self,
src: P,
dst: Q
) -> Result<()>
fn symlink_dir<P: AsRef<Path>, Q: AsRef<Path>>(
&self,
src: P,
dst: Q
) -> Result<()>
[src]
&self,
src: P,
dst: Q
) -> Result<()>