gen_with_pattern writes on file