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

Trait Implementations

impl Read for File

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

fn read_to_end(&mut self, vec: &mut Vec<u8>) -> Result<usize>

fn read_to_string(&mut self, string: &mut String) -> Result<usize>

fn bytes(&mut self) -> IntoIter<u8>

impl Write for File

fn write(&mut self, buf: &[u8]) -> Result<usize>

fn write_fmt(&mut self, args: Arguments) -> Result<()>

fn flush(&mut self) -> Result<()>

impl Seek for File

fn seek(&mut self, pos: SeekFrom) -> Result<u64>

impl Drop for File

fn drop(&mut self)