@@ -213,11 +213,11 @@ + (BOOL)fileExistsAtPath: (OFString*)path { #ifndef _WIN32 struct stat s; - if (stat([path cStringUsingEncoding: OF_STRING_ENCODING_NATIVE], + if (stat([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE], &s) == -1) return NO; #else struct _stat s; @@ -234,11 +234,11 @@ + (BOOL)directoryExistsAtPath: (OFString*)path { #ifndef _WIN32 struct stat s; - if (stat([path cStringUsingEncoding: OF_STRING_ENCODING_NATIVE], + if (stat([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE], &s) == -1) return NO; #else struct _stat s; @@ -253,11 +253,11 @@ } + (void)createDirectoryAtPath: (OFString*)path { #ifndef _WIN32 - if (mkdir([path cStringUsingEncoding: OF_STRING_ENCODING_NATIVE], + if (mkdir([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE], DIR_MODE)) #else if (_wmkdir([path UTF16String])) #endif @throw [OFCreateDirectoryFailedException @@ -311,11 +311,11 @@ #ifndef _WIN32 DIR *dir; struct dirent *dirent; - if ((dir = opendir([path cStringUsingEncoding: + if ((dir = opendir([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE])) == NULL) @throw [OFOpenFileFailedException exceptionWithClass: self path: path mode: @"r"]; @@ -378,11 +378,11 @@ } + (void)changeToDirectoryAtPath: (OFString*)path { #ifndef _WIN32 - if (chdir([path cStringUsingEncoding: OF_STRING_ENCODING_NATIVE])) + if (chdir([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE])) #else if (_wchdir([path UTF16String])) #endif @throw [OFChangeDirectoryFailedException exceptionWithClass: self @@ -392,11 +392,11 @@ #ifndef _PSP + (void)changeModeOfFileAtPath: (OFString*)path mode: (mode_t)mode { # ifndef _WIN32 - if (chmod([path cStringUsingEncoding: OF_STRING_ENCODING_NATIVE], mode)) + if (chmod([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE], mode)) @throw [OFChangeFileModeFailedException exceptionWithClass: self path: path mode: mode]; # else @@ -425,11 +425,11 @@ + (off_t)sizeOfFileAtPath: (OFString*)path { #ifndef _WIN32 struct stat s; - if (stat([path cStringUsingEncoding: OF_STRING_ENCODING_NATIVE], + if (stat([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE], &s) == -1) #else struct _stat s; if (_wstat([path UTF16String], &s) == -1) @@ -445,11 +445,11 @@ + (OFDate*)modificationDateOfFileAtPath: (OFString*)path { #ifndef _WIN32 struct stat s; - if (stat([path cStringUsingEncoding: OF_STRING_ENCODING_NATIVE], + if (stat([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE], &s) == -1) #else struct _stat s; if (_wstat([path UTF16String], &s) == -1) @@ -482,11 +482,11 @@ @try { # endif if (owner != nil) { struct passwd *passwd; - if ((passwd = getpwnam([owner cStringUsingEncoding: + if ((passwd = getpwnam([owner cStringWithEncoding: OF_STRING_ENCODING_NATIVE])) == NULL) @throw [OFChangeFileOwnerFailedException exceptionWithClass: self path: path owner: owner @@ -496,11 +496,11 @@ } if (group != nil) { struct group *group_; - if ((group_ = getgrnam([group cStringUsingEncoding: + if ((group_ = getgrnam([group cStringWithEncoding: OF_STRING_ENCODING_NATIVE])) == NULL) @throw [OFChangeFileOwnerFailedException exceptionWithClass: self path: path owner: owner @@ -514,11 +514,11 @@ @throw [OFUnlockFailedException exceptionWithClass: self]; } # endif - if (chown([path cStringUsingEncoding: OF_STRING_ENCODING_NATIVE], + if (chown([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE], uid, gid)) @throw [OFChangeFileOwnerFailedException exceptionWithClass: self path: path owner: owner @@ -593,12 +593,12 @@ destination = [OFString stringWithPath: destination, filename, nil]; } #ifndef _WIN32 - if (rename([source cStringUsingEncoding: OF_STRING_ENCODING_NATIVE], - [destination cStringUsingEncoding: OF_STRING_ENCODING_NATIVE])) + if (rename([source cStringWithEncoding: OF_STRING_ENCODING_NATIVE], + [destination cStringWithEncoding: OF_STRING_ENCODING_NATIVE])) #else if (!MoveFileW([source UTF16String], [destination UTF16String])) #endif @throw [OFRenameFileFailedException exceptionWithClass: self @@ -609,11 +609,11 @@ } + (void)deleteFileAtPath: (OFString*)path { #ifndef _WIN32 - if (unlink([path cStringUsingEncoding: OF_STRING_ENCODING_NATIVE])) + if (unlink([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE])) #else if (_wunlink([path UTF16String])) #endif @throw [OFDeleteFileFailedException exceptionWithClass: self path: path]; @@ -620,11 +620,11 @@ } + (void)deleteDirectoryAtPath: (OFString*)path { #ifndef _WIN32 - if (rmdir([path cStringUsingEncoding: OF_STRING_ENCODING_NATIVE])) + if (rmdir([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE])) #else if (_wrmdir([path UTF16String])) #endif @throw [OFDeleteDirectoryFailedException exceptionWithClass: self @@ -641,12 +641,12 @@ OFString *filename = [source lastPathComponent]; destination = [OFString stringWithPath: destination, filename, nil]; } - if (link([source cStringUsingEncoding: OF_STRING_ENCODING_NATIVE], - [destination cStringUsingEncoding: OF_STRING_ENCODING_NATIVE]) != 0) + if (link([source cStringWithEncoding: OF_STRING_ENCODING_NATIVE], + [destination cStringWithEncoding: OF_STRING_ENCODING_NATIVE]) != 0) @throw [OFLinkFailedException exceptionWithClass: self sourcePath: source destinationPath: destination]; objc_autoreleasePoolPop(pool); @@ -663,12 +663,12 @@ OFString *filename = [source lastPathComponent]; destination = [OFString stringWithPath: destination, filename, nil]; } - if (symlink([source cStringUsingEncoding: OF_STRING_ENCODING_NATIVE], - [destination cStringUsingEncoding: OF_STRING_ENCODING_NATIVE]) != 0) + if (symlink([source cStringWithEncoding: OF_STRING_ENCODING_NATIVE], + [destination cStringWithEncoding: OF_STRING_ENCODING_NATIVE]) != 0) @throw [OFSymlinkFailedException exceptionWithClass: self sourcePath: source destinationPath: destination]; @@ -699,11 +699,11 @@ @throw [OFInvalidArgumentException exceptionWithClass: [self class] selector: _cmd]; #ifndef _WIN32 - if ((fd = open([path cStringUsingEncoding: + if ((fd = open([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE], flags, DEFAULT_MODE)) == -1) #else if ((fd = _wopen([path UTF16String], flags, DEFAULT_MODE)) == -1) #endif