[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to get file size?
- From: steve donovan <steve.j.donovan@...>
- Date: Tue, 19 Apr 2011 11:42:55 +0200
On Tue, Apr 19, 2011 at 11:35 AM, Gilles Ganault <gilles.ganault@free.fr> wrote:
> libs_file = io.open("librt.so.0","r")
> print(fsize(libs_file))
> libs_file:close()
> ===========
>
> Am I missing some module it needs for file operation?
Not at all, you probably have not provided the full path to that
shared library, so libs_file ended up nil.
A tip: always say
f,err = io.open(...)
and check what err is when f is nil.
Some people do this
f = assert(io.open(...))
which does the job
steve d.