I "solved" the problem.
The file was opened with io_open(), for closing io_close() was called.
I replaced io_close() with io_fclose() and in io_pclose(), io_fclose(), auxclose(), io_popen() I just do a return 1.
Dont know the exact problem, but it works so for me.
>> I know there was a problem with aux_close in lua 5.0, but I am
>> wondering that it is still there in lua 5.1.
>No. That problem (of calling pclose even if the handle was not created
>by popen) was corrected in 5.1.
>> Any suggestions?