lua-users home
lua-l archive

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


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