DiabolusNeil

DEL 1.0

Nov 2nd, 2013
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. -- DEL 1.0 | Written by DiabolusNeil
  2. -- Minimum Requirement: Normal Computer
  3. -- Last Updated 11/2/2013
  4.  
  5. local tArgs = {...}
  6. if #tArgs < 1 then
  7.   print("Usage: <path1> [path2] [etc]")
  8.   return
  9. end
  10.  
  11. local sPath = tArgs
  12.  
  13. for i = 1, #sPath do
  14.   if fs.exists(sPath[i]) then
  15.     print("Are you sure you want to delete \""..sPath[i].."\"? Y/N")
  16.     while true do
  17.       local event, key = os.pullEvent("key")
  18.       if key == keys.y then
  19.         fs.delete(sPath[i])
  20.         print("File deleted")
  21.         break
  22.       elseif key == keys.n then
  23.         print("File not deleted")
  24.         break
  25.       end
  26.     end
  27.   else
  28.     print("Sorry, file \""..sPath[i].."\" does not exist")
  29.   end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment