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

Nicolas Martyanoff khaelin@REDACTED
Tue Jun 29 08:31:43 CEST 2021


Vimal Kumar <vimal7370@REDACTED> writes:

> I am not sure if any programming language (let alone Erlang) does that
> while listing folder contents. The . and .. are mere references to current
> folder and the parent folder by the OS, they does not exist in real if I am
> not wrong.

Other programming languages handle it as expected, e.g. in Ruby:

    Dir.entries(".")

On UNIX, . and .. are indeed no real files, but they behave as
hardlinks. Not being able to use them for example to list the content of a
directory is indeed a bug.

-- 
Nicolas Martyanoff
http://snowsyn.net
khaelin@REDACTED


More information about the erlang-questions mailing list