September 2013
Intermediate to advanced
548 pages
12h 25m
English
As a final example, we’ll use file:list_dir
and file:read_file_info to make a general-purpose
“find” utility.
The main entry point to this module is as follows:
| | lib_find:files(Dir, RegExp, Recursive, Fun, Acc0) |
The arguments are as follows:
DirThe directory name to start the file search in.
RegExpA shell-style regular expression to test the files we have
found. If the files we encounter match this regular expression,
then Fun(File, Acc) will be called, where File
is the name of the file that matches the regular
expression.
Recursive = true | falseA flag that determines whether search should recurse into the subdirectories of the current directory in the search path.
Fun(File, AccIn) -> AccOutA function that is applied to the ...
Read now
Unlock full access