write_primary_file
ret = write_primary_file(primary_path, "tkt");
ret = write_primary_file(primary_path, filename);