[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: problems with fh:read()
- From: Markus Huber <pulse@...>
- Date: Sat, 23 Nov 2002 13:39:55 +0100 (GMT)
The problem seems to occure only with Linux (the problem doesn't occure
with FreeBSD / Mac OS X). The first example works fine also with Linux:
fh,err=io.open("./Dummy","w+")
if err then print(err) end
fh:write("A")
fh:write("B")
fh:write("C")
fh:close()
Show File: --> ABC as expected
But if I add a simple read() the return of read and the resulting file
and are wrong.
fh,err=io.open("./Dummy","w+")
if err then print(err) end
fh:write("A")
fh:write("B")
fh:write("C")
print(fh:read("*a")) --> this example returns an empty string
fh:close()
Show File: --> <0 bytes> but should be also ABC
fh,err=io.open("./Dummy","w+")
if err then print(err) end
fh:write("Abc")
fh:write("Def")
fh:seek("set",1)
fh:write("Ghi")
print(fh:read("*a"))
fh:close()
Show File: --> AbcDef but should be AbcGhi
--
Markus