pub struct FileOpen { /* private fields */ }
Expand description
INTERNAL TYPE: do not use directly.
Use FileRead
, FileWrite
or FileEdit
instead.
Implementations§
source§impl FileOpen
impl FileOpen
sourcepub fn open<P: AsRef<Path>>(path: P, options: OpenOptions) -> Result<FileOpen>
pub fn open<P: AsRef<Path>>(path: P, options: OpenOptions) -> Result<FileOpen>
Open the file with the given OpenOptions
.
sourcepub fn open_abs<P: Into<PathAbs>>(
path: P,
options: OpenOptions
) -> Result<FileOpen>
pub fn open_abs<P: Into<PathAbs>>( path: P, options: OpenOptions ) -> Result<FileOpen>
Shortcut to open the file if the path is already absolute.
Typically you should use PathFile::open
instead (i.e. file.open(options)
or
file.read()
).
sourcepub fn metadata(&self) -> Result<Metadata>
pub fn metadata(&self) -> Result<Metadata>
Queries metadata about the underlying file.
This function is identical to std::fs::File::metadata except it has error messages which include the action and the path.
sourcepub fn try_clone(&self) -> Result<FileOpen>
pub fn try_clone(&self) -> Result<FileOpen>
Creates a new independently owned handle to the underlying file.
This function is identical to std::fs::File::try_clone except it has error
messages which include the action and the path and it returns a FileOpen
object.