@@ -326,21 +326,24 @@ } + (OFArray*)contentsOfDirectoryAtPath: (OFString*)path { OFMutableArray *files; +#ifndef _WIN32 of_string_encoding_t encoding; +#endif if (path == nil) @throw [OFInvalidArgumentException exception]; files = [OFMutableArray array]; - encoding = [OFString nativeOSEncoding]; #ifndef _WIN32 DIR *dir; struct dirent *dirent; + + encoding = [OFString nativeOSEncoding]; if ((dir = opendir([path cStringWithEncoding: encoding])) == NULL) @throw [OFOpenFileFailedException exceptionWithPath: path mode: @"r"]; @@ -644,11 +647,13 @@ + (void)moveItemAtPath: (OFString*)source toPath: (OFString*)destination { void *pool; of_stat_t s; +#ifndef _WIN32 of_string_encoding_t encoding; +#endif if (source == nil || destination == nil) @throw [OFInvalidArgumentException exception]; pool = objc_autoreleasePoolPush(); @@ -658,13 +663,13 @@ @throw [OFCopyItemFailedException exceptionWithSourcePath: source destinationPath: destination]; } +#ifndef _WIN32 encoding = [OFString nativeOSEncoding]; -#ifndef _WIN32 if (rename([source cStringWithEncoding: encoding], [destination cStringWithEncoding: encoding])) { #else if (_wrename([source UTF16String], [destination UTF16String])) { #endif