[][src]Module heim_common::utils::fs

Filesystem I/O abstractions.

This module should be used only in heim sub-crates, do not use it directly.

Why in a hell there is a sync FS operations in the async crate?!

At the moment runtime crate does not provides the abstractions for the files IO. Yet, in our case, FS opts are needed only for Linux and only procfs is used there. Since procfs stores data in the memory, it would not be very terrible to read this data synchronously -- it still will be quick enough.

When runtime crate will provide fully async FS abstractions, we will switch to them.

Functions

path_exists

Returns future which checks if path T points to some file.

read_dir

Returns stream of files and directories contained in the T directory.

read_first_line

Returns future which tries to read the first line from file.

read_into

Reads file and attempts to parse it's contents into R type.

read_lines

Returns stream of lines yielded from file with path path.

read_lines_into

Returns stream which reads lines from file and tries to parse them with help of FromStr trait.

read_to_string

Read path file asynchronously and convert it contents into a string.