Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function displayHelp()
- print("prot <filename>")
- end
- tArg = {...}
- function doIt()
- fileName = tArg[1]
- if protectedFiles == nil then
- protectedFiles = {}
- end
- file = fs.open(fileName, "a")
- table.insert(protectedFiles, fileName)
- fs.open = function(path, mode)
- for a = 1, #protectedFiles do
- if mode == "w" or mode == "wb" or mode == "a" then
- if string.find(protectedFiles[a], path) ~= nil then
- return false
- else
- oldFsOpen(path, mode)
- end
- else
- oldFsOpen(path, mode)
- end
- end
- end
- end
- if tArg[ 1 ] == nil then
- displayHelp()
- return false
- else
- doIt()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement