Skip to content

Commit 252e7f2

Browse files
Fixing #412 (#413)
Added the header for fstream and altered the `boost::filesystem::ofstream`to `std:ofstream` calls. Then I built the project and it works.
1 parent 7632006 commit 252e7f2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/osm_store.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
#include "osm_store.h"
33
#include <iostream>
4+
#include <fstream>
45
#include <iterator>
56
#include <unordered_map>
67

@@ -116,7 +117,7 @@ void mmap_dir_t::open_mmap_file(std::string const &dir_filename, size_t file_siz
116117

117118
std::string new_filename = mmap_dir_filename + "/mmap_" + to_string(mmap_dir.files.size()) + ".dat";
118119
std::cout << "Filename: " << new_filename << ", size: " << mmap_file_size << std::endl;
119-
if(boost::filesystem::ofstream(new_filename.c_str()).fail())
120+
if(std::ofstream(new_filename.c_str()).fail())
120121
throw std::runtime_error("Failed to open mmap file");
121122
boost::filesystem::resize_file(new_filename.c_str(), 0);
122123
boost::filesystem::resize_file(new_filename.c_str(), mmap_file_size);
@@ -131,7 +132,7 @@ void mmap_dir_t::resize_mmap_file(size_t add_size)
131132
auto size = increase + (add_size + alignment) - (add_size % alignment);
132133

133134
std::string new_filename = mmap_dir_filename + "/mmap_" + to_string(mmap_dir.files.size()) + ".dat";
134-
if(boost::filesystem::ofstream(new_filename.c_str()).fail())
135+
if(std::ofstream(new_filename.c_str()).fail())
135136
throw std::runtime_error("Failed to open mmap file");
136137
boost::filesystem::resize_file(new_filename.c_str(), size);
137138
mmap_file_thread_ptr = std::make_shared<mmap_file>(new_filename.c_str(), 0);

0 commit comments

Comments
 (0)