Closed TheCymaera closed 1 year ago
Agreed. It's not just Node.JS: supporting seeing a POSIX dirent link type
would be a major boon.
It would be great to consider what other types we might be able to support here too. Sockets, character devices, block devices, FIFO ought all seem near-at-hand, like something that could be supported by the API in general & identified in directory listing.
Thanks for filing this! I noticed that there is another issue: https://github.com/whatwg/fs/issues/54 you filed, so closing this one as duplicate.
The ability to detect symbolic links will help guard against circular references when recursively reading a directory. For example, the following function breaks when encountering a symlink that refers to its own parent:
A potential solution is to add a boolean property to indicate that a handle was created from a symlink. For example:
Alternatively, directory iterators can return objects similar to Dirents from Node.js, which we can use to create handles. For example: