Advertisement
minimite

wipe

Sep 16th, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.35 KB | None | 0 0
  1. local blacklist = {"rom"}
  2. local list = fs.list(shell.dir())
  3.  
  4. local function isblacklisted(sPath)
  5. for _, sblacklistedPath in ipairs(blacklist) do
  6. if sblacklistedPath == sPath then
  7. return true
  8. end
  9. end
  10. return false
  11. end
  12.  
  13. for n, obj in pairs(list) do
  14. if not isblacklisted(obj) then
  15. if obj ~= shell.getRunningProgram() then
  16. fs.delete(obj)
  17. end
  18. end
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement