[squeak-dev] Strange Unix file behavior?

Randal L. Schwartz merlyn at stonehenge.com
Thu Aug 7 15:49:18 UTC 2008

>>>>> "Tony" == Tony Garnock-Jones <tonyg at lshift.net> writes:

Tony> What would you expect read(2) on a directory to return? Is it
Tony> standardised?

In the early days, read(2) on a fd opened on a directory returned
18-byte chunks... 2 bytes for inode, 16 bytes for NUL-padded filename.

When directories got more complicated, any differences were hidden between
readdir(3) routines, but ultimately, those still called read(2) on the
directory, just as you could directly.  Those routines are still documented in
my modern OpenBSD and OSX releases, and are the routines that Perl uses
to implement Perl's readdir() and glob() routines.

Reading further in the thread, it's not surprising that Linux reinvented the
wheel to a completely confusing result for those of us with an actual Unix
background.  Linux ain't Unix.

Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion

More information about the Squeak-dev mailing list