From 82e1a690d97cd9d9f392beccbb6b1d35f3573f08 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Tue, 1 Dec 2009 14:24:55 +0000 Subject: Fixed directory renaming. --- src/platforms/posix/posixFile.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/platforms/posix/posixFile.cpp') 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); -- cgit v1.2.3