lua-users home
lua-l archive

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


Hi:

> see I would have expected the opposite... because in C you have exit()
> and at_exit(), I thought lua_close() would be called at_exit() by the
> interpreter.  Doing ctrl + d would be more "instantaneous"?  Kinda
> wish both had called the __gc eitherway ~

Maybe you are thinking of ^C, ( in unix ) which usually sends SIGINT.
^D in a unix terminal only signals eof on stdin, it's not more
instantaneous unless your program sits in a tight loop reading stdin
and exiting after it. AAMOF, a typical C filter program reads from
stdin till EOF and then returns from main which in turn calls exit (
The C runtime does aproximately exit(main(ac, av)) ).  If you have
access to a bash shell, try 'sleep 10; cat' and you'll see how the
sleep ignores your ^D ( it should work in nearly any, bash is just
where I've tested it. The ;cat was to avoid EOF killing the shell, but
in my bash tests it is not necessary, YMMV ).

Francisco Olarte.