tarred = filetype =~ /tar archive/
if gzipped || bzipped || zipped || tarred
tarred = filetype =~ /tar archive/
if gzipped || bzipped || zipped || tarred
- tmpfile = Tempfile.new("trace.#{id}")
+ file = Tempfile.new("trace.#{id}")
- system("tar -zxOf #{trace_name} > #{tmpfile.path}")
+ system("tar -zxOf #{trace_name} > #{file.path}")
- system("tar -jxOf #{trace_name} > #{tmpfile.path}")
+ system("tar -jxOf #{trace_name} > #{file.path}")
- system("tar -xOf #{trace_name} > #{tmpfile.path}")
+ system("tar -xOf #{trace_name} > #{file.path}")
- system("gunzip -c #{trace_name} > #{tmpfile.path}")
+ system("gunzip -c #{trace_name} > #{file.path}")
- system("bunzip2 -c #{trace_name} > #{tmpfile.path}")
+ system("bunzip2 -c #{trace_name} > #{file.path}")
- system("unzip -p #{trace_name} -x '__MACOSX/*' > #{tmpfile.path} 2> /dev/null")
+ system("unzip -p #{trace_name} -x '__MACOSX/*' > #{file.path} 2> /dev/null")
- tmpfile.unlink
-
- file = tmpfile.file
else
file = File.open(trace_name)
end
else
file = File.open(trace_name)
end
+++ /dev/null
-# Hack TempFile to let us get at the underlying File object as ruby
-# does a half assed job of making TempFile act as a File
-class Tempfile
- def file
- @tmpfile
- end
-end