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]

[src]

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

[src]

Open a directory descriptor at specified path

[src]

List subdirectory of this dir

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

[src]

Open subdirectory

Read link in this directory

[src]

Open file for reading in this directory

[src]

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

[src]

Open file for append, create if necessary

[src]

Deprecated since 0.1.7

: please use write_file instead

Create file for writing (and truncate) in this directory

Deprecated alias for write_file

[src]

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.

[src]

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

[src]

Create a subdirectory in this directory

[src]

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

[src]

Remove a subdirectory in this directory

Note only empty directory may be removed

[src]

Remove a file in this directory

[src]

Get the path of this directory (if possible)

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

[src]

Returns metadata of an entry in this directory

Trait Implementations

impl AsRawFd for Dir
[src]

[src]

Extracts the raw file descriptor. Read more

impl FromRawFd for Dir
[src]

[src]

Constructs a new instance of Self from the given raw file descriptor. Read more

impl IntoRawFd for Dir
[src]

[src]

Consumes this object, returning the raw underlying file descriptor. Read more

impl Drop for Dir
[src]

[src]

Executes the destructor for this type. Read more

impl Debug for Dir
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Dir

impl Sync for Dir