os-lib icon indicating copy to clipboard operation
os-lib copied to clipboard

`OutputStream.available` always retrun 0

Open sequencer opened this issue 6 years ago • 1 comments

I wanna peek the how many bytes in OutputStream that I can read, in case of blocked by process. However I found when I use sub.stdout.available, it always returns 0, seems available didn't implemented by os.OutputStream nor java.lang.ProcessPipeInputStream. Thus there might be no way to implement a non-block reading by os-lib

sequencer avatar Oct 31 '19 15:10 sequencer

@sequencer you can always use _.wrapped.available but yea... it is long standing bug. Still... _.available does not guarantee anything. Spec says it is only estimation.

scalway avatar Jun 07 '22 11:06 scalway