[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: require ignores setglobals()
- From: Björn De Meyer <bjorn.demeyer@...>
- Date: Fri, 07 Feb 2003 13:46:11 +0100
Ack! It got wrapped. Ok, I'm trying again...
function safeload(filename, glob)
local act
glob = glob or getglobals()
act = function()
local f, e
f, e = loadfile(filename)
if f then return f()
else return nil, e end
end
setglobals(act,glob)
return act()
end
--
"No one knows true heroes, for they speak not of their greatness." --
Daniel Remar.
Björn De Meyer
bjorn.demeyer@pandora.be