diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2021-11-11 09:54:21 -0500 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2021-11-15 12:08:49 -0500 |
commit | 9b575f1c734c052b695ce921fb6412b22c18fdb4 (patch) | |
tree | aa4c80b07b92e0385ae0c45c62b44fcb86045310 /src/dbwrapper.cpp | |
parent | 7f0f853373703a020529dd9394fca525475086b7 (diff) |
Improve fs::PathToString documentation
Diffstat (limited to 'src/dbwrapper.cpp')
-rw-r--r-- | src/dbwrapper.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dbwrapper.cpp b/src/dbwrapper.cpp index 2fdc54464a..dbae2c45f2 100644 --- a/src/dbwrapper.cpp +++ b/src/dbwrapper.cpp @@ -136,6 +136,10 @@ CDBWrapper::CDBWrapper(const fs::path& path, size_t nCacheSize, bool fMemory, bo TryCreateDirectories(path); LogPrintf("Opening LevelDB in %s\n", fs::PathToString(path)); } + // PathToString() return value is safe to pass to leveldb open function, + // because on POSIX leveldb passes the byte string directly to ::open(), and + // on Windows it converts from UTF-8 to UTF-16 before calling ::CreateFileW + // (see env_posix.cc and env_windows.cc). leveldb::Status status = leveldb::DB::Open(options, fs::PathToString(path), &pdb); dbwrapper_private::HandleError(status); LogPrintf("Opened LevelDB successfully\n"); |