lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It appears that the command line Lua interpreter does not trap SIGPIPE:

rjek@trite:~$ lua
Lua 5.1.4  Copyright (C) 1994-2008, PUC-Rio
> f = assert(io.popen("true", "w"))
> f:write "Hello, world."
> f:close()
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?