read() on dir

Christoph Kukulies kuku at kukulies.org
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
" ==============================================================================
../                                                                                                                            
./
.vbox-kuku-ipc/
com.apple.launchd.AUnEPqi6tC/
com.apple.launchd.atGF3BeR4X/
com.apple.launchd.lOdpt02m8q/
powerlog/
FirstBootAfterUpdate
FirstBootCleanupHandled
OSL_PIPE_501_SingleOfficeIPC_57c1e9acbaf815f47e314f3cbee8d6=
fseventsd-uuid

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?

—
Christoph 
a UNIX dinosaur





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20210317/aa2c078a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3363 bytes
Desc: not available
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20210317/aa2c078a/attachment.bin>


More information about the macports-users mailing list