Trait cap_fs_ext::Reopen
source · pub trait Reopen {
// Required method
fn reopen(&self, options: &OpenOptions) -> Result<Self>
where Self: Sized;
}
Expand description
A trait for the reopen
function.
Required Methods§
sourcefn reopen(&self, options: &OpenOptions) -> Result<Self>where
Self: Sized,
fn reopen(&self, options: &OpenOptions) -> Result<Self>where Self: Sized,
Re-open a file, producing a new independent handle.
This operation isn’t supported by all operating systems in all
circumstances, or in some operating systems in any circumstances, so it
may return an io::ErrorKind::Other
error if the file cannot be
reopened.
For files that aren’t deleted, it’s supported mostly-reliably on Linux and Windows and somewhat-reliably on Darwin. Beyond that, it works reliably on terminal device files and (slowly) on directories. It’s not possible to implement this operation with POSIX APIs alone (short of traversing the entire filesystem), so further support will depend on operating systems providing OS-specific APIs.
This function takes an OpenOptions
, however it does not acquire new
permissions that the original handle lacks.