racket / zuo

A tiny Racket for scripting
Other
263 stars 27 forks source link

The behavior of `fd-read` does not conform with the description in the documentation. #2

Closed Antigen-1 closed 2 years ago

Antigen-1 commented 2 years ago

According to the document, "The result is eof if amount is not 0 or 'avail and no bytes are available before an end-of-file; otherwise, it is a string containing the read bytes......The result can be an empty string only if amount is 0 or 'avail." Yet I got an empty string, instead of an eof, when I tried running (fd-read (hash-ref (process "/bin/ls" "." (hash 'stderr 'pipe)) 'stderr) eof) on Linux 5.15.0-43-generic #46~20.04.1-Ubuntu.

mflatt commented 2 years ago

Thanks! I've corrected the documentation to say that a string is returned when eof is provided.