<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><div data-crea="font-wrapper" style="font-family: Tahoma; font-size: 16px; direction: ltr"><div><div>
<div data-crea="font-wrapper" style="font-family: Tahoma;font-size: 16px;direction: ltr"><div style="font-family: Tahoma;font-size: 16px"></div>Maybe there is a philosophical reason:<div>A process always has a current directory (maybe except some zombies).</div><div>It is a bit like "cogito, ergo sum.". If you accept this, then it is a trivial fact that you have to be somewhere,</div><div>the short form of which is ".". There is no more reason to state it every time.</div><div><br></div><div>".." is a similar item. Every directory has a parent (well, nearly every directory), </div><div>so there is also no need to include that in the results.<br><br>More important is that one can use these shortcuts in functions like file:list_dir()/1.<br><div></div><br><br>Dieter<br><br><div data-anchor="reply-title">Am Di., Jun. 29, 2021 06:11 schrieb Yao Bao <<a href="mailto:free7by@163.com" target="_blank" tabindex="-1" rel="external">free7by@163.com</a>>:</div><blockquote><div>Hello,<br><br>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.<br><br>I would expect the result from file:list_dir/1 in Erlang is the same as readdir(dirp) in C.<br><br>Is there any (historical) reason why these two special directories missing from the return?<br><br>Cheers,<br>Yao</div></blockquote></div></div>
</div></div></div></body></html>