lua-users home
lua-l archive

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


On Fri, Jul 15, 2011 at 17:00, Dave Collins
<Dave.Collins@mercatustechnologies.com> wrote:
> I'm doing something wrong.
>
> (I am converting an api call into a local file call. It should just read the entire 70K response (in json format) into the var. I parse it out later.)
>
> This hangs my app:
>
> function file_getdata()
>        local data_file_path = gre.SCRIPT_ROOT .. "/myfile.json"
>        local f = io.open(data_file_path)
>        f = io.read("*all")
local data = f:read("*all")
>        f = io.close()
f:close()
>        return f
return data
> end
>