mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
throw on failed writing and port fs namespace changes from oxen-core
This commit is contained in:
parent
6cde9062b5
commit
a0d3ab125a
|
@ -70,7 +70,8 @@ main(int argc, char* argv[])
|
|||
std::string data{ss.str()};
|
||||
if (data[0] == 'l' or data[0] == 'd')
|
||||
{
|
||||
std::ofstream ofs{outputfile};
|
||||
fs::ofstream ofs{outputfile};
|
||||
ofs.exceptions(fs::ofstream::failbit);
|
||||
ofs << data;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,14 @@
|
|||
namespace fs = ghc::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
namespace fs
|
||||
{
|
||||
using namespace std::filesystem;
|
||||
using ifstream = std::ifstream;
|
||||
using ofstream = std::ofstream;
|
||||
using fstream = std::fstream;
|
||||
} // namespace fs
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef _MSC_VER
|
||||
|
|
Loading…
Reference in a new issue