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

Vimal Kumar <[email protected]>
Newsgroups gmane.comp.lang.erlang.general
Message-ID <CAMO=R+Rgd=f6MYLM9FC-iJU7p62Aw1XpAyjsmKfn8_X6banUsw@mail.gmail.com>
Hi,

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.

Vimal

On Tue, 29 Jun 2021, 09:41 Yao Bao, <[email protected]> wrote:

> 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
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.