ec_file

Helper functions for working with files.

Helper functions for working with files.

DATA TYPES

option() = recursive

Functions


exists(Filename::filename() (see module file)) -> boolean()

copy(From::name() (see module file), To::name() (see module file), Options::[option()]) -> ok | {error, Reason::term()}

copy an entire directory to another location.

copy(From::filename() (see module file), To::filename() (see module file)) -> ok | {error, Reason::term()}

copy a file including timestamps,ownership and mode etc.

md5sum(Value::string() | binary()) -> string()

return an md5 checksum string or a binary. Same as unix utility of same name.

remove(Path::name() (see module file), Options::[option()]) -> ok | {error, Reason::term()}

delete a file. Use the recursive option for directories.

  Example: remove("./tmp_dir", [recursive]).
  

remove(Path::name() (see module file)) -> ok | {error, Reason::term()}

delete a file.

is_symlink(Path::name() (see module file)) -> boolean()

indicates witha boolean if the path supplied refers to symlink.

type(Path::name() (see module file)) -> file | symlink | directory

returns the type of the file.

real_dir_path(Path::name() (see module file)) -> name() (see module file)

gets the real path of a directory. This is mostly useful for resolving symlinks. Be aware that this temporarily changes the current working directory to figure out what the actual path is. That means that it can be quite slow.

insecure_mkdtemp() -> TmpDirPath::name() (see module file)

make a unique temorory directory. Similar function to BSD stdlib function of the same name.

mkdir_p(Path::name() (see module file)) -> ok | {error, Reason::term()}

Makes a directory including parent dirs if they are missing.

mkdir_path(Path::name() (see module file)) -> ok | {error, Reason::term()}

Makes a directory including parent dirs if they are missing.

read(FilePath::filename() (see module file)) -> binary() | {error, Reason::term()}

read a file from the file system. Provide UEX exeption on failure.

write(FileName::filename() (see module file), Contents::string()) -> ok | {error, Reason::term()}

write a file to the file system. Provide UEX exeption on failure.

write_term(FileName::filename() (see module file), Term::term()) -> ok | {error, Reason::term()}

write a term out to a file so that it can be consulted later.

find(FromDir::name() (see module file), TargetPattern::string()) -> [name() (see module file)]

Finds files and directories that match the regexp supplied in the TargetPattern regexp.

View Functions