CrosS_light, on 17 April 2013 - 12:26 PM, said:
function shell.run(file, ...)
file = tostring(file)
if not fs.exists(file) then
error(file..": File not found")
end
env = {yourReplacedFunctions}
env._api = fs.getName(file)
local success, param = loadfile(file)
if not success then
error(param)
end
setfenv(param, env)
local success, err = pcall(param, ...)
if not success then
error(err)
end
end
function fs.delete(file)
--Your code
if not valid then
error(tostring(getfenv(2)._name)..": You don't have permission to delete that file!")
end
end
...That should work...


Posted by
