Advertisement
BigSHinyToys

File System Lock

Nov 22nd, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. local tArgs = {...}
  2. local backUpFs = fs
  3. local fileSys = {}
  4. fileSys.combine = backUpFs.combine
  5. fileSys.isReadOnly = function(...)
  6.     return true
  7. end
  8. fileSys.getSize = backUpFs.getSize
  9. fileSys.move = function(...)
  10.     return false
  11. end
  12. fileSys.exists = backUpFs.exists
  13. fileSys.copy = function(...)
  14.     return false
  15. end
  16. fileSys.getFreeSpace = backUpFs.getFreeSpace
  17. fileSys.makeDir = function(...)
  18.     return false
  19. end
  20. fileSys.delete = function(...)
  21.     return false
  22. end
  23. fileSys.open = function(location,mode,...)
  24.     if mode == "r" then
  25.         return backUpFs.open(location,mode,...)
  26.     else
  27.         return
  28.     end
  29. end
  30. fileSys.list = function(this,...)
  31.     if this == "" or this == "\\" or this == "/" or this == "\\\\" or this == "//" then
  32.         return {"root"}
  33.     else
  34.         return backUpFs.list(this,...)
  35.     end
  36. end
  37. fileSys.getDrive = backUpFs.getDrive
  38. fileSys.getName = backUpFs.getname
  39. fileSys.isDir = backUpFs.isDir
  40. fs = fileSys
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement