lua-users home
lua-l archive

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


You need to tell it where to seek from.  ie:

file:seek("set", 5)
file:seek("cur", 5)
file:seek("end", -5)

Love, Light and Peace,
- Peter Loveday
Director of Development, eyeon Software


----- Original Message ----- 
From: "Serge Semashko" <serge@lxnt.info>
To: "Lua list" <lua@bazar2.conectiva.com.br>
Sent: Wednesday, June 18, 2003 1:51 PM
Subject: file:seek() is broken in Lua 5


> ---------------------------------------------------------------------
> file = io.open("test.bin", "rb")
> file:seek(5)
> ---------------------------------------------------------------------
>
> /cygdrive/d/tools/lua: E:\Projects\test.lua:2: bad argument #1 to `seek'
(invalid mode)
> stack traceback:
>         [C]: in function `seek'
>         E:\Projects\test.lua:2: in main chunk
>         [C]:[C]
>
>