J. Browns Pipe library error
- Posted by Chris Burch <chriscrylex at aol.com> Dec 22, 2003
- 374 views
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