mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-29 18:09:22 +08:00
Use Files::write_all_lines()
This commit is contained in:
parent
e4548a8cf4
commit
15ca6919ad
@ -132,12 +132,7 @@ namespace vcpkg
|
||||
System::println(System::color::error, "failed: %s: cannot handle file type", it->path().u8string());
|
||||
}
|
||||
|
||||
std::fstream listfile(paths.listfile_path(bpgh), std::ios_base::out | std::ios_base::binary | std::ios_base::trunc);
|
||||
for (const std::string& line : output)
|
||||
{
|
||||
listfile << line << "\n";
|
||||
}
|
||||
listfile.close();
|
||||
Files::write_all_lines(paths.listfile_path(bpgh), output);
|
||||
}
|
||||
|
||||
static void remove_first_n_chars(std::vector<std::string>* strings, const size_t n)
|
||||
|
@ -175,13 +175,7 @@ static void upgrade_to_slash_terminated_sorted_format(std::vector<std::string>*
|
||||
#if 0
|
||||
// Replace the listfile on disk
|
||||
const fs::path updated_listfile_path = listfile_path.generic_string() + "_updated";
|
||||
std::fstream output(updated_listfile_path, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc);
|
||||
for (const std::string& line : *lines)
|
||||
{
|
||||
output << line << "\n";
|
||||
}
|
||||
output.close();
|
||||
|
||||
Files::write_all_lines(updated_listfile_path, *lines);
|
||||
fs::rename(updated_listfile_path, listfile_path);
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user