Struct std::fs::File
[−]
[src]
pub struct File { fd: usize, }
A Unix-style file
Fields
fd | The id for the file |
Methods
impl File
unsafe fn from_fd(fd_muxed: usize) -> Result<File>
fn open(path: &str) -> Result<File>
Open a new file using a path
fn create(path: &str) -> Result<File>
Create a new file using a path
fn dup(&self) -> Result<File>
Duplicate the file
fn path(&self) -> Result<PathBuf>
Get the canonical path of the file
fn sync_all(&mut self) -> Result<()>
Flush the file data and metadata
fn sync_data(&mut self) -> Result<()>
Flush the file data
fn set_len(&mut self, size: usize) -> Result<()>
Truncates the file