This question already has an answer here:
- When did directories stop being readable as files? 1 answer
- octal dump of directory 3 answers
I read in The Design of the UNIX Operating System that directories are files containing the names of each file they contain. So I tried
cating one on my Mac, and it resulted in an error:
cat: ./: Is a directory
But I then tested it in System 7 UNIX, and it worked.
Why does this not work in modern operating systems? Is a directory no longer a file, or did someone decide we shouldn't be able to read them?