Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Synchronous vs. Asynchronous



On Aug 22, 12:31am, Vincent Lefevre wrote:
}
} Under Mac OS X, I get:
} 
} prunille% cat >(sleep 100)
} cat: /dev/fd/31: Permission denied

I'm pretty sure PWS meant >>(sleep 100); cat is going to try to read
from its filename argument, and >(...) is opening a write-only socket,
so what's more surprising is that it doesn't give an error elsewhere.

macadamia[502] ls -l >(sleep 100)
prw-rw----  0 schaefer  staff  0 Aug 21 21:47 /dev/fd/12|

} Under Linux:
} 
} xvii% cat >(sleep 100)
} ^C^C^C^C^C

torch[594] ls -l >(sleep 10)
l-wx------  1 schaefer schaefer 64 Aug 21 21:52 /proc/self/fd/12 -> pipe:[1059569]

Seems like "cat" should have complained about a read-only file there, I
wonder why it doesn't.  Oh:

torch[599] ls -Ll >(sleep 10)                                          4.2.0
prw-------  1 schaefer schaefer 0 Aug 21 21:55 /proc/self/fd/12|

So the pipe to which /dev/fd/12 points behaves as readable on Linux.

} prunille% printf "a%s\n" {1..9} >>(while read s; do sleep 1; echo $s; done)
} a1
} a2
} a3
} ^Ca4
} ^C^C^Ca5
} ^C^C^Ca6
} ^C^Ca7
} a8
} a9
} prunille%
} 
} is uninterruptible

Hmm, under 4.3.9 that's interruptible on MacOS:

macadamia[505] printf "a%s\n" {1..9} >>(while read s; do sleep 1; echo $s; done)
a1
a2
a3
^C%
macadamia[506] a4
a5
a6
a7
a8
a9

With the latest CVS, it is not interruptible.  I'm not sure which change
would have brought that on.



Messages sorted by: Reverse Date, Date, Thread, Author