How does POSIX distinguish files from directories?
On DOS and Windows, a directory is nothing more than a file with the D attribute. I tried to figure out how to differ them on POSIX-compatible operating systems like Linux and BSD, but it doesn't look as a quick and simple task. (This is probably because I don't use such an operating system, and therefore cannot test anything myself.)
I ask this question to improve my manual about naming files. Currently, it has the following passage:
Directory names can also be referred as file names; directories are nothing more than files with the D attribute.
I'm not sure this quote would be correct for POSIX.