[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: popen problem with command line interpreter
- From: Rob Kendrick <rjek@...>
- Date: Fri, 26 Feb 2010 14:21:46 +0000
It appears that the command line Lua interpreter does not trap SIGPIPE:
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> f = assert(io.popen("true", "w"))
> f:write "Hello, world."
rjek@trite:~$ echo $?
strace suggests it's trying to flush data to a pipe for which there is
nothing connected to at the other end (because 'true' exits straight
I'm not sure how the situation could be improved much. In the ideal
world, it would be nice for write or close to return some sort of error
condition when this occurs, but I can't quite see how to do this
Perhaps simply an error message before the interpreter vanishes?