[][src]Struct unix::file::File

pub struct File { /* fields omitted */ }

File descriptor, closed on drop

Implementations

impl File[src]

pub fn chmod(&self, mode: Mode) -> Result<(), Error>[src]

Change the mode of the file.

pub fn stat(&self) -> Result<Stat, Error>[src]

Return information about the file.

pub fn sync(&self, metadata: bool) -> Result<(), Error>[src]

Flush all cached modifications of the file to the device. If metadata, also flush modifications of the metadata.

pub fn truncate(&self, length: u64) -> Result<(), Error>[src]

Truncate the file to the given length.

pub fn exec(&self, argv: &Nul<&Str>, envp: &Nul<&Str>) -> Result<Void, Error>[src]

Execute the program file.

The current program of the calling process is replaced with the new one, with a fresh stack, heap, and data segment. argv is an array of argument strings to pass to the new program. By convention, the first should be the name of the program file. env is an array of strings, conventionally of form "key=value", which are passed as the environment.

pub fn fd(&self) -> isize[src]

Return the file descriptor of the File.

pub fn new(fd: isize) -> Option<Self>[src]

Make a File of a file descriptor, which is checked for validity.

pub const fn new_unchecked(fd: isize) -> Self[src]

Make a File of a file descriptor, which is not checked.

Trait Implementations

impl Debug for File[src]

impl Drop for File[src]

impl MapExt for File[src]

type MapSpec = Option<Segment>

Specifier of which part of value to map

impl Read<u8> for File[src]

type Err = Error

impl TryClone for File[src]

type Error = Error

impl TryFrom<File> for Entries[src]

type Error = Error

The type returned in the event of a conversion error.

impl Write for File[src]

impl Write<u8> for File[src]

type Err = Error

Auto Trait Implementations

impl Send for File[src]

impl Sync for File[src]

impl Unpin for File[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.