lua-users home
lua-l archive

Re: How to get file size?

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


On Tue, Apr 19, 2011 at 4:35 AM, Gilles Ganault wrote:
> Am I missing some module it needs for file operation?
You should check the return value and error message from io.open :
local libs_file, err = io.open("librt.so.0","r")
if (libs_file) then
 print(fsize(libs_file))
 libs_file:close()
else
 print("ERROR:", err)
end
 - Jeff

AltStyle によって変換されたページ (->オリジナル) /