diff options
Diffstat (limited to 'src/platforms/posix/posixFile.cpp')
-rw-r--r-- | src/platforms/posix/posixFile.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/platforms/posix/posixFile.cpp b/src/platforms/posix/posixFile.cpp index 7ee9f197..b814b758 100644 --- a/src/platforms/posix/posixFile.cpp +++ b/src/platforms/posix/posixFile.cpp @@ -396,7 +396,11 @@ void posixFile::rename(const path& newName) const vmime::string newNativePath = posixFileSystemFactory::pathToStringImpl(newName); posixFile dest(newName); - dest.createFile(); + + if (isDirectory()) + dest.createDirectory(); + else + dest.createFile(); if (::rename(m_nativePath.c_str(), newNativePath.c_str()) == -1) posixFileSystemFactory::reportError(m_path, errno); |