def normalise_zone_and_add_prepended_names(infile, outfile)
infile = (infile.to_s+"").untaint
outfile = (outfile.to_s+"").untaint
if File.exist?(outfile)
File.delete(outfile)
end
@line_num = 0
begin
File.open(outfile, File::CREAT|File::RDWR) { |f|
begin
IO.foreach(infile) { |line|
ret = process_line(line)
next if !ret
if (ret)
new_line, type, last_name = ret
line_to_write = prepare(last_name) + NAME_SEPARATOR + type.to_s + SORT_SEPARATOR + new_line
f.write(line_to_write)
end
}
rescue Exception => e
KASPAuditor.exit("ERROR - Can't open zone file : #{infile.inspect} : #{e}", 1)
end
}
rescue Exception => e
KASPAuditor.exit("ERROR - Can't open temporary output file : #{outfile.inspect} : #{e}", 1)
end
end