mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
create all subdirectories for non-case sensitive systems
This commit is contained in:
parent
c82ef1ee8f
commit
ef3ec33ba3
15
NetDb.cpp
15
NetDb.cpp
@ -250,21 +250,20 @@ namespace data
|
|||||||
LogPrint (directory.string(), " doesn't exist, trying to create it.");
|
LogPrint (directory.string(), " doesn't exist, trying to create it.");
|
||||||
if (!boost::filesystem::create_directory (directory))
|
if (!boost::filesystem::create_directory (directory))
|
||||||
{
|
{
|
||||||
LogPrint("Failed to create directory ", directory.string());
|
LogPrint (eLogError, "Failed to create directory ", directory);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// list of chars might appear in base64 string
|
// list of chars might appear in base64 string
|
||||||
const char * chars = GetBase64SubstitutionTable (); // 64 bytes
|
const char * chars = GetBase64SubstitutionTable (); // 64 bytes
|
||||||
boost::filesystem::path suffix;
|
|
||||||
for (int i = 0; i < 64; i++)
|
for (int i = 0; i < 64; i++)
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
auto p = directory / (std::string ("r") + chars[i]);
|
||||||
suffix = std::string ("/r") + chars[i];
|
if (!boost::filesystem::exists (p) && !boost::filesystem::create_directory (p))
|
||||||
#else
|
{
|
||||||
suffix = std::string ("\\r") + chars[i];
|
LogPrint (eLogError, "Failed to create directory ", p);
|
||||||
#endif
|
return false;
|
||||||
if (!boost::filesystem::create_directory( boost::filesystem::path (directory / suffix) )) return false;
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ namespace data
|
|||||||
for (int i = 0; i < 64; i++)
|
for (int i = 0; i < 64; i++)
|
||||||
{
|
{
|
||||||
auto path1 = path / (std::string ("p") + chars[i]);
|
auto path1 = path / (std::string ("p") + chars[i]);
|
||||||
if (!boost::filesystem::create_directory (path1))
|
if (!boost::filesystem::exists (path1) && !boost::filesystem::create_directory (path1))
|
||||||
{
|
{
|
||||||
LogPrint (eLogError, "Failed to create directory ", path1);
|
LogPrint (eLogError, "Failed to create directory ", path1);
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user