

The next-next step is to RabbitMQ and setup one producer and three consumers - one for files, one for directories and one for symlinks. The next step is to make this message based and have the walk/1 method send messages to a consumer who will do the printing. I’ll be working on answering #1-3 on my way to learning #4 - but if you have any feedback I would love to hear it.


Does calling walk(P) in a foreach prevent tail recursion optimizations?.walk ( Path ) -> io : format ( " ~s~n ", ), FileType = file_type ( Path ), case FileType of file -> ok symlink -> ok directory -> Children = filelib : wildcard ( Path ++ "/*" ), lists : foreach ( fun ( P ) -> walk ( P ) end, Children ) end.
Erlang filelib code#
test file readable return exit code error (non zero) if a file is not. file_type ( Path ) -> IsRegular = filelib : is_regular ( Path ), case IsRegular of true -> file false -> case is_symlink ( Path ) of true -> symlink false -> directory end end. main() -> case filelib:isfile(/etc/mtab) of true -> ok -> erlang:halt(1) end. is_symlink ( Path ) -> case file : read_link_info ( Path ) of -> true _ -> false end. include_lib ( "kernel/include/file.hrl" ).
Erlang filelib how to#
In particular, functions that useĮrlang:raise/3 could now need a spec with a no_return() return type to avoid an unwanted warning.ĭEVELOPMENT HOWTO guide has been added that describes how to build and test Erlang/OTP when fixing bugs or developing new functionality. Because of that, Dialyzer can potentially generate new warnings.
Erlang filelib download#

The JIT now works for 64-bit ARM processors. Erlang’s filelib:foldfiles () function is cool and a good example of how easy things should be.Maybe expression EEP-49 is fully supported as the feature maybe_expr.įor more details about new features and potential incompatibilities see Similar options can be used toĮrl for enabling/disabling features allowed at runtime. Features can be enabled/disabled during compilation with options (ordinary and +term) toĮrlc as well as with directives in the file. Added support for selectable features as described in EEP-60.New functions uniq/1 uniq/2 in the lists module.New functions groups_from_list/2 and groups_from_list/3 in the.New function filelib:ensure_path/1 will ensure that all directories for the given path exists.Some of the new features are highlighted below.īelow are some highlights of the release: Highlights rc2 stdlib Kerl like this: kerl build 25.0-rc2 25.0-rc2.Įrlang/OTP 25 is a new major release with new features, improvements as well as a few incompatibilities.
Erlang filelib install#
You can also install the latest release using We encourage users to try it out and give us feedback either by creating an issue hereĮrlangforums or the mailing artifacts for the release can be downloaded from theĮrlang/OTP Github release and you can view the new documentation atĮrlang/OTP 25.0. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. All feedback is welcome, even if it is only to say that it works for you. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. The intention with this release is to get feedback from our users. Erlang/OTP 25-rc2 is the second release candidate of three before the OTP 25.0 release.
