Posted 02 July 2015 - 10:12 PM
I have this sand boxing probram so far thanks to the people on this forum:
It is supposed to make the 'wow' directory act as the root directory. The problem is whenever you type any program, even if it is in the 'wow' directory, it will say program not found. I have tried everything I can think of but it is not working!
local sPath = "wow"
local _fs = {}
for k, v in pairs( fs ) do
_fs[k] = v --# Store the old, unmodified version of the function
fs[k] = function( path, ... ) --# Override the function
_fs[k]( _fs.combine( sPath, path ), ... ) --# And make it point to the 'sandbox_directory'
return _fs[k]( _fs.combine( sPath, path ), ... )
end
end
term.setCursorPos(1,1)
term.setBackgroundColor(colors.black)
term.setTextColor(colors.yellow)
term.clear()
print(os.version())
while true do
term.setTextColor(colors.yellow)
write("> ")
term.setTextColor(colors.white)
local input = read()
shell.run(input)
end
--# Restore the native functions
for k, v in pairs( _fs ) do
fs[k] = v
end
It is supposed to make the 'wow' directory act as the root directory. The problem is whenever you type any program, even if it is in the 'wow' directory, it will say program not found. I have tried everything I can think of but it is not working!