Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Example: Tell me, is this a file or directory?

A directory is a file (and IIRC e.g. Plan 9 decided they should be readable just like normal files and there shouldn't be any special readdir syscalls). You can see its attributes to figure out the rest.

If not for strong Linux limitations (because of alleged hardlink knot-tying problem) and belief that it just cannot be both, transparent archive access through a filesystem would be a thing. As well as metadata access (`play ./file.mp3` vs `edit ./file.mp3/id3v2`). People of the past seemed to have paid great attention to interoperability and effort to make common interfaces; folks of the modern age ('00s and later) love unique and completely incompatible solutions to the same problem.



Neat. I’ve often wished I could cat a directory or ls a file. Plan9 sounds like something I would have enjoyed using.


> I’ve often wished I could cat a directory

This was possible in the beginning. But then came the moral police and deprived us of this freedom, because they deemed it to be "confusing".

See, for example, The Unix Programming Environment, by Kernighan and Pike, page 51 [0]:

Despite their fundamental properties inside the kernel, directories sit in the file system as ordinary files. They can be read as ordinary files. (...) The time has come to look at the bytes in a directory:

    $ od -cb .

[0] https://archive.org/details/UnixProgrammingEnviornment/page/...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: