Description:
removes imported testdata file after extracted
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r270:6fd950650700 - - 1 file changed: 2 inserted, 0 deleted

@@ -61,24 +61,26
61 61 cmd = "tar -xvf #{testdata_filename} -C #{extract_dir}"
62 62 elsif ext=='.zip'
63 63 cmd = "unzip -o #{testdata_filename} -d #{extract_dir}"
64 64 else
65 65 return nil
66 66 end
67 67
68 68 system(cmd)
69 69
70 70 files = Dir["#{extract_dir}/**/*1*.in"]
71 71 return nil if files.length==0
72 72
73 + File.delete(testdata_filename)
74 +
73 75 return File.dirname(files[0])
74 76 end
75 77
76 78 def save_testdata_file(tempfile)
77 79 ext = TestdataImporter.long_ext(tempfile.original_filename)
78 80 testdata_filename = File.join(Dir.tmpdir,"#{@problem.name}#{ext}")
79 81
80 82 return nil if tempfile==""
81 83
82 84 if tempfile.instance_of?(Tempfile)
83 85 tempfile.close
84 86 FileUtils.move(tempfile.path,testdata_filename)
You need to be logged in to leave comments. Login now