[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: problems with fh:read() correction
- From: Markus Huber <pulse@...>
- Date: Sat, 23 Nov 2002 14:08:18 +0100 (GMT)
The last example was incorrect and not complete to show the read()
return error. Here is the corrected example:
fh,err=io.open("./Dummy","w+")
if err then print(err) end
fh:write("Abc")
fh:write("Def")
fh:write("Ghi") --> File should be AbcDefGhi
--> Filepointer ^
fh:seek("set",3)
fh:write("Jkl") --> File should be AbcJklGhi
--> Filepointer ^
print(fh:read("*a")) --> should print Ghi but returns an empty string
fh:close()
Show File: --> AbcDefGhi but should be AbcJklGhi
--
Markus