mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-23 10:42:35 +00:00
Rename added
This commit is contained in:
1 parent
682ce8a270
commit
7547d675a2
2 files changed
+16
No files matched your search
@@ -281,6 +281,20 @@ namespace fs {
|
||||
return fs_lib::remove(path);
|
||||
}
|
||||
|
||||
bool Rename (std::string_view from, std::string_view to)
|
||||
{
|
||||
try
|
||||
{
|
||||
fs_lib::rename (from, to);
|
||||
}
|
||||
catch (std::exception& ex)
|
||||
{
|
||||
LogPrint (eLogError, "FS: Can't rename from ", from, " to ", to, " : ", ex.what());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CreateAndReserveFile (const std::string& path, size_t reserve)
|
||||
{
|
||||
if (fs_lib::exists(path)) return false;
|
||||
|
||||
@@ -139,6 +139,8 @@ namespace fs {
|
||||
*/
|
||||
bool Remove(const std::string & path);
|
||||
|
||||
bool Rename (std::string_view from, std::string_view to);
|
||||
|
||||
/**
|
||||
* @brief Check existence of file
|
||||
* @param path Absolute path to file
|
||||
|
||||
Reference in new issue
Block a user