lua-users home
lua-l archive

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

>I'm having problems with writeto().
>If I do:
>   writeto(/tmp/test")
>   write("hello")
>   writeto()
>It will create the file, put nothing in it and then crash on the closing
>This is really odd since readfrom() works fine for me.
>Anyone else have this problem?

It seems I have a similar problem under BeOS (PR2), at least when I do it
from within one of my own (C++) applications. In my tests, however, the
data ("hello") get written. I'm not quite sure whether the file get closed
(by "writeto()"), but I was able to verify the written data using an
editor. I haven't tried a similar sequence in the interactive lua
interpreter, but I'll try it tomorrow.

I have also done things like this from within a C++ application on
Macintosh, both 68K and PPC, without noticing any problems.

In all my tests, the filename in the first writeto has been just a simple
name like "lua.out", no path, but I guess that's irrelevant.

I'll try to find out more about this problem. (I use Lua 3.0, of course.)