Search Haskell Channel Logs

Saturday, February 4, 2017

#haskell channel featuring erisco, Liskni_si, jarlg, osa1, geekosaur, barrucadu,

jarlg 2017-02-04 09:05:11
I have a two processes that can communicate through a handle. What's a good way to transfer a file between them? I could split my file into lines, then send a flag signifying EOF, but I'm sure there's a better solution. Any ideas?
erisco 2017-02-04 09:05:32
is it more kosher to clamp or modulo with toEnum?
barrucadu 2017-02-04 09:06:27
jarlg: You could first send the length of the file in bytes, and then just send the file
barrucadu 2017-02-04 09:06:35
The receiver will know when to stop reading from the handle
jarlg 2017-02-04 09:06:47
barrucadu: Brilliant, thanks! :)
Liskni_si 2017-02-04 09:12:49
jarlg: not sure if it's relevant for your usecase, but if that handle happens to be an AF_UNIX socket, you can send an open file descriptor as is :-)
jarlg 2017-02-04 09:15:47
Liskni_si: I'm not sure -- the handles are created using createProcess (shell ) { ... }, which I think basically spawns a shell process and handles to communicate with it.
geekosaur 2017-02-04 09:16:17
pipe, except on *bsd
Liskni_si 2017-02-04 09:16:18
jarlg: oh, that's a pipe then
Liskni_si 2017-02-04 09:16:36
geekosaur: is it a unix socket there?
geekosaur 2017-02-04 09:16:43
socketpair, yes
osa1 2017-02-04 09:41:32
does anyone know any benchmarks that compare extensible-effects with transformers?