read() on dir

Christoph Kukulies kuku at
Wed Mar 17 15:19:36 UTC 2021

There was some discussion in the FreeBSD mailing list about changing the behaviour of a directory fd WRT
the read() function. A change has been made towards disallowing this from FreeBSD 12.2 onwards (IIRC) and there was big discussion on this since it
„violates“ the cleanness of UNIX, that a file is a file is a file or „everything is a file“. Many purists were against the disallowing behaviour.

At that time I cross checked whether this is allowed in macOS and - again IIRC - at that time (Catalina) it was disallowed either to do
a „vi .“:

$ vi /tmp

" ============================================================================
" Netrw Directory Listing                                        (netrw v168)
"   /tmp
"   Sorted by      name
"   Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,\~\=\*$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$
"   Quick Help: <F1>:help  -:go up dir  D:delete  R:rename  s:sort-by  x:special
" ==============================================================================

Now I’m surprised that this is possible (again?) under BigSur. I may be totally wrong on this. I don’t have the
opportunity to cross check that against Catalina. Could someone confirm or proove the opposite?

a UNIX dinosaur

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3363 bytes
Desc: not available
URL: <>

More information about the macports-users mailing list