10
votes
how to tell, from the outside, if the output stream of a process has been closed?
The stream isn’t closed; the fact that you are able to try writing to it without receiving an EBADF error is proof of that. (See man 2 write for details.)
On Linux, given that you’re looking at a pipe,...
3
votes
how to tell, from the outside, if the output stream of a process has been closed?
Update: After re-reading your question, I see that you were asking about monitoring it externally. Using lsof or looking in /proc/$PID/fd/$FD for the pipe info and trying to find a matching pair ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
pipe × 1884bash × 574
shell × 335
shell-script × 226
io-redirection × 212
linux × 140
grep × 128
command-line × 113
fifo × 109
stdin × 81
stdout × 78
tee × 71
xargs × 70
find × 69
awk × 57
sed × 52
cat × 51
text-processing × 50
ssh × 47
tar × 47
tail × 46
zsh × 44
files × 43
file-descriptors × 43
process × 38