odeke-em / drive

Google Drive client for the commandline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

named pipes: handle reads when isFifo

odeke-em opened this issue · comments

Reading from a named pipe with no content will hang infinitely until content is passed in.
Simple test here:

$ fifoPath=testPipe
$ mkfifo $fifoPath
$ sleeper() { i=0;while [ $i -lt 20 ];do echo -e "sleeping $i\r"; let i=i+1;sleep 1;done; echo "done here $i" >> $fifoPath; }
$ sleeper & # Put it in the background
$ cat $fifoPath # Going to hang for the 20 seconds -- this can happen infinitely

Addressed by #209