-module(bugreport). -author('mickael.remond@IDEALX.com'). -compile([export_all]). loop(Max) -> file:make_dir('/tmp/test'), loop(1, Max). loop(Max, Max) -> ok; loop(N, Max) -> File = integer_to_list(N), Command = lists:append("touch /tmp/test/" , File), os:cmd(Command), io:format("Created file : ~s - ", [File]), %% file:list_dir make the beam VM crash %% when the number of file in the directory reach 999 {ok, FileList} = file:list_dir('/tmp/test'), Length = length(FileList), io:format("file:list_dir length : ~s~n", [integer_to_list(Length)]), loop(N + 1, Max).