Only try to delete a file that actually exists.

This commit is contained in:
Moritz Bunkus 2005-09-03 12:03:31 +00:00
parent 6fe7ae4afd
commit 3cdfb8b3fe

View File

@ -24,7 +24,8 @@ class Test
def unlink_tmp_files
n = "mkvtoolnix-auto-test-" + $$.to_s + "-"
Dir.entries("/tmp").each do |e|
File.unlink("/tmp/#{e}") if (e =~ /^#{n}/)
File.unlink("/tmp/#{e}") if ((e =~ /^#{n}/) and
File.exists?("/tmp/#{e}")))
end
end