Index: src/OFFileManager.m ================================================================== --- src/OFFileManager.m +++ src/OFFileManager.m @@ -848,20 +848,31 @@ [self removeItemAtPath: [path stringByAppendingPathComponent: item]]; objc_autoreleasePoolPop(pool2); } - } +#ifndef OF_WINDOWS + if (rmdir([path cStringWithEncoding: + [OFSystemInfo native8BitEncoding]]) != 0) +#else + if (_wrmdir([path UTF16String]) != 0) +#endif + @throw [OFRemoveItemFailedException + exceptionWithPath: path + errNo: errno]; + } else { #ifndef OF_WINDOWS - if (remove([path cStringWithEncoding: - [OFSystemInfo native8BitEncoding]]) != 0) + if (unlink([path cStringWithEncoding: + [OFSystemInfo native8BitEncoding]]) != 0) #else - if (_wremove([path UTF16String]) != 0) + if (_wunlink([path UTF16String]) != 0) #endif - @throw [OFRemoveItemFailedException exceptionWithPath: path - errNo: errno]; + @throw [OFRemoveItemFailedException + exceptionWithPath: path + errNo: errno]; + } objc_autoreleasePoolPop(pool); } #ifdef OF_HAVE_LINK