Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local olddelete = fs.delete
- local oldopen = fs.open
- OVERRIDE = {}
- OVERRIDE.whitelist = {"whitelist table for files"}
- fs.delete = function(sFile)
- for i,v in pairs(whitelist) do
- if v == sFile then
- error("Access denied",0)
- end
- end
- olddelete(sFile)
- end
- fs.open = function(sFile, sMode)
- for i,v in pairs(OVERRIDE.whitelist) do
- if v == sFile then
- if sMode == "w" or sMode == "a" or sMode == "wb" or sMode == "ab" then
- sMode = string.sub(sMode,#sMode,#sMode) == "b" and "rb" or "r"
- end
- end
- end
- oldopen(sFile,sMode)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement