Module lrs::file

File handling.

Sub-modules

NameDescription
flags

File flag constants.

mode

File mode constants.

Types

KindNameDescription
Struct AccessMode

A way to access a file.

This type is used to check whether a file can be accessed with a certain set of permissions.

Enum Advice

Advice used to optimize file access.

Struct Device

A device.

Enum DeviceType

The type of a device.

Struct File

An opened file in a filesystem.

Struct FileFlags

Flags for opening and modifying a file.

Struct FileSeals

Flags for file sealing.

Struct Info

Information about a file.

Struct MemfdFlags

Flags for opening a memory file.

Struct Mode

The permissions of a file.

Enum Seek

A seek operation.

Enum TimeChange

A time change.

Enum Type

Type of a directory entry.

Functions

NameDescription
can_access

Checks whether a file can be accessed with a certain mode.

change_mode

Change the mode of a file.

change_owner

Changes the owner of a file.

change_owner_no_follow

Changes the owner of a file without following symbolic links.

create_device

Creates a device special file.

create_dir

Creates a directory.

create_file

Creates a file.

exchange

Atomically exchanges two files.

exists

Checks whether a file exists.

get_attr

Retrieves an attribute of a file.

get_attr_buf

Retrieves an attribute of a file.

get_attr_no_follow

Retrieves an attribute of a file without following symbolic links.

get_attr_no_follow_buf

Retrieves an attribute of a file without following symbolic links.

info

Retrieves information about a file.

info_no_follow

Retrieves information about a file without following symbolic links.

link

Creates a hard link.

list_attr

Creates an iterator over all attributes in a file.

list_attr_buf

Creates an iterator over all attributes in a file.

list_attr_buf_no_follow

Creates an iterator over all attributes in a file without following symbolic links.

list_attr_no_follow

Creates an iterator over all attributes in a file without following symbolic links.

list_attr_size

Retrieves the buffer size required for all attributes in a file.

list_attr_size_no_follow

Retrieves the buffer size required for all attributes in a file without following symbolic links.

read_link

Retrieves the target of a symbolic link.

read_link_buf

Retrieves the target of a symbolic link.

real_path

Returns a canonicalized absolute path.

real_path_buf

Returns a canonicalized absolute path.

remove

Removes a file.

remove_attr

Removes an attribute of a file.

remove_attr_no_follow

Removes an attribute of a file without following symbolic links.

rename

Renames a file.

set_attr

Sets an attribute of a file.

set_attr_no_follow

Sets an attribute of a file without following symbolic links.

set_len

Truncates a file to a certain length.

set_times

Changes the access and modification times of a file.

set_times_no_follow

Changes the access and modification times of a file without following symbolic links.

symlink

Creates a symbolic link.