Skip to content

Instantly share code, notes, and snippets.

@isokcevic
Created August 27, 2013 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isokcevic/6352403 to your computer and use it in GitHub Desktop.
Save isokcevic/6352403 to your computer and use it in GitHub Desktop.
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