J. Browns Pipe library error

new topic     » topic index » view thread      » older message » newer message

Hi

Try this

--with trace
include graphics.e
include pipeio.e

sequence line
clear_screen()

puts(1, "Debug 1\n")

sequence data
integer pid, pin, pout, perr
object c

while(1) do

data = popen("/home/crylex/euphoria/bin/exu", {"./subprocess1.exu"})
--data = popen("/bin/echo", {"Hello", "jobby"})

pid = data[1]
pin = data[2]
pout = data[3]
perr = data[4]

puts(1,"Debug 2\n")

c = os_read(pout, 256)

puts(1,"Debug 3\n")

if atom(c) then
    printf(1, "Failed on read with error %x", os_errno)
    abort(1)
end if

puts(1, c)

--have to stop the program in order to see the output!
--line = gets(0)

VOID = os_kill(pid, 15)
--close(pout)

end while

--------------------------------------------------------

Eventually you'll get Errno = 24

Little c prog to get errno string gives

Too many open files

Doesn't seem to be a way to close open pipes in this lib (is an os_close 
function, but this needs a handle, and can't see any way of getting a 
handle)

Any ideas anyone

Regards

Chris

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu