Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local fs2 = fs2 or {}
- local hidetable = hidetable or {}
- local authlist = {shell.getRunningProgram() = true} -- Edit this to contain your authorized programs.
- local fs2.open = fs2.open or fs.open
- local fs2.delete = fs2.delete or fs.delete
- local fs2.list = fs2.list or fs.list
- local fs2.copy = fs2.copy or fs.copy
- local fs2.move = fs2.move or fs.move
- local fs2.ioO = fs2.ioO or io.open
- local function isallowed(file)
- for k,v in pairs(authlist) do
- if v == file then return true end
- end
- return false
- end
- local function ishidden(filename)
- if hidetable[filename] then return true else return false end
- end
- fs.hide = function(filename)
- if not isallowed(shell.getRunningProgram()) then
- error("attempt to call nil", 2)
- return nil
- else
- if not hidetable[filename] then
- hidetable[filename] = true
- return true
- end
- end
- fs.show = function(filename)
- if not isallowed(shell.getRunningProgram()) then
- error("attempt to call nil", 2)
- return nil
- else
- if hidetable[filename] then
- hidetable[filename] = nil
- return true
- end
- end
- end
- -- Rest to work on later, gonna work on other projects...
Advertisement
Add Comment
Please, Sign In to add comment