Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local youNoToushDese = { -- ze absolut paths of la files that the knights who say ni must never access
- "startup",
- }
- local _fs = {}
- for k,v in pairs(fs) do
- _fs[k] = v
- end
- local notgood = function() --in case of any need of change
- error("access denied")
- end
- local search = function(tbl,str)
- str = fs.combine("",str)
- for k,v in pairs(tbl) do
- if v == str then
- return k, v
- end
- end
- return false
- end
- fs.isReadOnly = function(path)
- if search(youNoToushDese,path) then
- return true
- else
- return _fs.isReadOnly(path)
- end
- end
- fs.getSize = function(path)
- if search(youNoToushDese,path) then
- return 0
- else
- return _fs.getSize(path)
- end
- end
- fs.makeDir = function(path)
- if search(youNoToushDese,path) then
- notgood()
- else
- return _fs.makeDir(path)
- end
- end
- fs.move = function(fromPath,toPath)
- if search(youNoToushDese,fromPath) or search(youNoToushDese,toPath) then
- notgood()
- else
- return _fs.move(fromPath,toPath)
- end
- end
- fs.copy = function(fromPath,toPath)
- if search(youNoToushDese,fromPath) or search(youNoToushDese,toPath) then
- notgood()
- else
- return _fs.copy(fromPath,toPath)
- end
- end
- fs.delete = function(path)
- if search(youNoToushDese,path) then
- notgood()
- else
- return _fs.delete(path)
- end
- end
- fs.open = function(path,mode)
- if search(youNoToushDese,path) then
- notgood()
- else
- return _fs.open(path,mode)
- end
- end
- _G.fs = fs
- if fs.exists("userstartup") then
- shell.run("userstartup")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement