[SOLVED]Need help with love.data.unpack
Posted: Wed Jan 31, 2024 9:43 pm
Code: Select all
local file = love.filesystem.read("a.bin")
local s = love.data.unpack("I4", file, 5)
-- is any difference between above and below?
local file = love.filesystem.newFile("a.bin")
file:open("r")
file:seek(4)
local s = love.data.unpack("I4", file:read(4))
-- err: data string too short
local s = love.data.unpack("I4", file:read())
-- err: data string too short