Struct openat::Dir [] [src]

pub struct Dir(_);

A safe wrapper around directory file descriptor

Construct it either with Dir::cwd() or Dir::open(path)

Methods

impl Dir
[src]

Creates a directory descriptor that resolves paths relative to current workding directory (AT_FDCWD)

Open a directory descriptor at specified path

List subdirectory of this dir

You can list directory itself if "." is specified as path.

Open subdirectory

Read link in this directory

Open file for reading in this directory

Open file for writing, create if necessary, truncate on open

Open file for append, create if necessary

Deprecated since 0.1.7

: please use write_file instead

Create file for writing (and truncate) in this directory

Deprecated alias for write_file

Create file if not exists, fail if exists

This function checks existence and creates file atomically with respect to other threads and processes.

Technically it means passing O_EXCL flag to open.

Open file for reading and writing without truncation, create if needed

Make a symlink in this directory

Note: the order of arguments differ from symlinkat

Create a subdirectory in this directory

Rename a file in this directory to another name (keeping same dir)

Remove a subdirectory in this directory

Note only empty directory may be removed

Remove a file in this directory

Get the path of this directory (if possible)

This uses symlinks in /proc/self, they sometimes may not be available so use with care.

Returns metadata of an entry in this directory

Trait Implementations

impl AsRawFd for Dir
[src]

Extracts the raw file descriptor. Read more

impl Debug for Dir
[src]

Formats the value using the given formatter.