diff options
Diffstat (limited to 'toolsrc/src')
| -rw-r--r-- | toolsrc/src/commands_installation.cpp | 7 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg.cpp | 8 |
2 files changed, 2 insertions, 13 deletions
diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index e61a2dbfe..605343dfc 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -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) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 6f1d30bc5..98c53f9ef 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -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 } |
