file:list_dir/1 cannot lists dot(.) and dot-dot(..) directories

Yao Bao free7by@REDACTED
Tue Jun 29 02:29:42 CEST 2021


Hello,

I'm trying to list all files in a directory, then I found file:list_dir/1, it works fine but dot(.) and dot-dot(..) is missing.

I would expect the result from file:list_dir/1 in Erlang is the same as readdir(dirp) in C.

Is there any (historical) reason why these two special directories missing from the return?

Cheers,
Yao


More information about the erlang-questions mailing list