这是indexloc提供的服务,不要输入任何密码
Skip to content

named pipes: handle reads when isFifo #208

@odeke-em

Description

@odeke-em

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions