kizz12

delete

Apr 21st, 2015
812
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. local tArgs = { ... }
  2. if #tArgs < 1 then
  3.     print( "Usage: rm <path>" )
  4.     return
  5. end
  6.  
  7.  
  8.  
  9. local sPath = shell.resolve( tArgs[1] )
  10. local tFiles = fs.find( sPath )
  11. if #tFiles > 0 then
  12.     for n,sFile in ipairs( tFiles ) do
  13.         if sFile=="startup" or sFile=="users" or sFile=="newuser" or sFile=="master" or sFile=="guest" or sFile=="door" or sFile=="edit" or sFile=="extend" or sFile=="help" or sFile=="log" or sFile=="logout" or sFile=="delete" then
  14.         print"Can't delete this file!"
  15.         return
  16.         end
  17.        
  18.         fs.delete( sFile )
  19.     end
  20. else
  21.     printError( "No matching files" )
  22. end
Advertisement
Add Comment
Please, Sign In to add comment