Module leo_file

leo_file is utilities for file processing.

References

Description

leo_file is utilities for file processing

Function Index

ensure_dir/1ensures that the directory name required to create D exists.
file_delete_all/1Remove all files of the target.
file_get_canonicalized_path/1Canonicalize by following every symlink in every component of the given name.
file_get_mount_path/1Retrieve file mount path(s).
file_get_remain_disk/1Retrieve remain disk capacity of the target.
file_get_total_size/1Retrieve total of the file size.
file_touch/1Touch a file.
file_unconsult/2Unconsult the file.
pread/3Erlang file:pread/3's wrapper function <http://www.erlang.org/doc/man/file.html#pread-3>.

Function Details

ensure_dir/1

ensure_dir(Name) -> ok | {error, Reason}

ensures that the directory name required to create D exists

Fork the code from https://github.com/erlang/otp/blob/OTP-20.1.2/lib/stdlib/src/filelib.erl#L220-L251 To fix https://github.com/leo-project/leofs/issues/878

file_delete_all/1

file_delete_all(FilePath) -> ok | {error, any()}

Remove all files of the target

file_get_canonicalized_path/1

file_get_canonicalized_path(FilePath) -> {ok, string()} | {error, any()}

Canonicalize by following every symlink in every component of the given name

file_get_mount_path/1

file_get_mount_path(FilePath) -> ok | {error, any()}

Retrieve file mount path(s)

file_get_remain_disk/1

file_get_remain_disk(Params) -> ok | {error, any()}

Retrieve remain disk capacity of the target

file_get_total_size/1

file_get_total_size(Path) -> ok | {error, any()}

Retrieve total of the file size

file_touch/1

file_touch(FilePath) -> ok | {error, any}

Touch a file

file_unconsult/2

file_unconsult(FilePath, Term) -> ok | {error, any()}

Unconsult the file

pread/3

pread(IoDevice, Location, Number) -> {ok, Data} | eof | {error, Reason}

Erlang file:pread/3's wrapper function <http://www.erlang.org/doc/man/file.html#pread-3>


Generated by EDoc