Created
August 27, 2013 11:29
-
-
Save isokcevic/6352403 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
offending_files = %w(.Spotlight-V100 .Trashes ._.Trashes) | |
base_path = "/media/mid/ADATA UFD2/" | |
while true | |
puts "Press enter to attempt to delete stuff.." | |
gets | |
puts "Checking if path exists" | |
if File.exists?( base_path ) | |
puts "Exists, deleting" | |
offending_files.each do |f| | |
puts " " + f | |
File.delete(base_path + f) | |
end | |
%x[ sudo umount "/media/mid/ADATA UFD2/" ] | |
puts "stick SHOULD be safe to remove now" | |
else | |
puts "NOT FOUND!" | |
puts "please insert stick, and try again" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment