@@ -136,11 +136,11 @@ static int of_stat(OFString *path, of_stat_t *buffer) { #if defined(OF_WINDOWS) - return _wstat64([path UTF16String], buffer); + return _wstat64(path.UTF16String, buffer); #elif defined(OF_AMIGAOS) BPTR lock; # ifdef OF_AMIGAOS4 struct ExamineData *ed; # else @@ -342,11 +342,11 @@ static void setSymbolicLinkDestinationAttribute(of_mutable_file_attributes_t attributes, of_stat_t *s, OFURL *URL) { #ifdef OF_FILE_MANAGER_SUPPORTS_SYMLINKS - OFString *path = [URL fileSystemRepresentation]; + OFString *path = URL.fileSystemRepresentation; # ifndef OF_WINDOWS if (S_ISLNK(s->st_mode)) { of_string_encoding_t encoding = [OFLocale encoding]; char destinationC[PATH_MAX]; @@ -372,17 +372,17 @@ } # else WIN32_FIND_DATAW data; if (func_CreateSymbolicLinkW != NULL && - FindFirstFileW([path UTF16String], &data) && + FindFirstFileW(path.UTF16String, &data) && (data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) && data.dwReserved0 == IO_REPARSE_TAG_SYMLINK) { HANDLE handle; OFString *destination; - if ((handle = CreateFileW([path UTF16String], 0, + if ((handle = CreateFileW(path.UTF16String, 0, (FILE_SHARE_READ | FILE_SHARE_WRITE), NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT, NULL)) == INVALID_HANDLE_VALUE) @throw [OFRetrieveItemAttributesFailedException exceptionWithURL: URL @@ -496,11 +496,11 @@ - (OFStream *)openItemAtURL: (OFURL *)URL mode: (OFString *)mode { void *pool = objc_autoreleasePoolPush(); OFFile *file = [[OFFile alloc] - initWithPath: [URL fileSystemRepresentation] + initWithPath: URL.fileSystemRepresentation mode: mode]; objc_autoreleasePoolPop(pool); return [file autorelease]; @@ -517,11 +517,11 @@ @throw [OFInvalidArgumentException exception]; if (![[URL scheme] isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; - path = [URL fileSystemRepresentation]; + path = URL.fileSystemRepresentation; if (of_lstat(path, &s) == -1) @throw [OFRetrieveItemAttributesFailedException exceptionWithURL: URL errNo: errno]; @@ -549,17 +549,17 @@ - (void)of_setPOSIXPermissions: (OFNumber *)permissions ofItemAtURL: (OFURL *)URL attributes: (of_file_attributes_t)attributes { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS - uint16_t mode = [permissions uInt16Value] & 0777; - OFString *path = [URL fileSystemRepresentation]; + uint16_t mode = permissions.uInt16Value & 0777; + OFString *path = URL.fileSystemRepresentation; # ifndef OF_WINDOWS if (chmod([path cStringWithEncoding: [OFLocale encoding]], mode) != 0) # else - if (_wchmod([path UTF16String], mode) != 0) + if (_wchmod(path.UTF16String, mode) != 0) # endif @throw [OFSetItemAttributesFailedException exceptionWithURL: URL attributes: attributes failedAttribute: of_file_attribute_key_posix_permissions @@ -574,11 +574,11 @@ ofItemAtURL: (OFURL *)URL attributeKey: (of_file_attribute_key_t)attributeKey attributes: (of_file_attributes_t)attributes { #ifdef OF_FILE_MANAGER_SUPPORTS_OWNER - OFString *path = [URL fileSystemRepresentation]; + OFString *path = URL.fileSystemRepresentation; uid_t uid = -1; gid_t gid = -1; of_string_encoding_t encoding; if (owner == nil && group == nil) @@ -644,11 +644,11 @@ id object; if (URL == nil) @throw [OFInvalidArgumentException exception]; - if (![[URL scheme] isEqual: _scheme]) + if (![URL.scheme isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; keyEnumerator = [attributes keyEnumerator]; objectEnumerator = [attributes objectEnumerator]; @@ -684,14 +684,14 @@ bool ret; if (URL == nil) @throw [OFInvalidArgumentException exception]; - if (![[URL scheme] isEqual: _scheme]) + if (![URL.scheme isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; - if (of_stat([URL fileSystemRepresentation], &s) == -1) + if (of_stat(URL.fileSystemRepresentation, &s) == -1) return false; ret = S_ISREG(s.st_mode); objc_autoreleasePoolPop(pool); @@ -706,14 +706,14 @@ bool ret; if (URL == nil) @throw [OFInvalidArgumentException exception]; - if (![[URL scheme] isEqual: _scheme]) + if (![URL.scheme isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; - if (of_stat([URL fileSystemRepresentation], &s) == -1) + if (of_stat(URL.fileSystemRepresentation, &s) == -1) return false; ret = S_ISDIR(s.st_mode); objc_autoreleasePoolPop(pool); @@ -727,17 +727,17 @@ OFString *path; if (URL == nil) @throw [OFInvalidArgumentException exception]; - if (![[URL scheme] isEqual: _scheme]) + if (![URL.scheme isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; - path = [URL fileSystemRepresentation]; + path = URL.fileSystemRepresentation; #if defined(OF_WINDOWS) - if (_wmkdir([path UTF16String]) != 0) + if (_wmkdir(path.UTF16String) != 0) @throw [OFCreateDirectoryFailedException exceptionWithURL: URL errNo: errno]; #elif defined(OF_AMIGAOS) BPTR lock; @@ -792,22 +792,22 @@ OFString *path; if (URL == nil) @throw [OFInvalidArgumentException exception]; - if (![[URL scheme] isEqual: _scheme]) + if (![URL.scheme isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; - path = [URL fileSystemRepresentation]; + path = URL.fileSystemRepresentation; #if defined(OF_WINDOWS) HANDLE handle; WIN32_FIND_DATAW fd; path = [path stringByAppendingString: @"\\*"]; - if ((handle = FindFirstFileW([path UTF16String], + if ((handle = FindFirstFileW(path.UTF16String, &fd)) == INVALID_HANDLE_VALUE) { int errNo = 0; if (GetLastError() == ERROR_FILE_NOT_FOUND) errNo = ENOENT; @@ -1006,14 +1006,14 @@ of_stat_t s; if (URL == nil) @throw [OFInvalidArgumentException exception]; - if (![[URL scheme] isEqual: _scheme]) + if (![URL.scheme isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; - path = [URL fileSystemRepresentation]; + path = URL.fileSystemRepresentation; if (of_lstat(path, &s) != 0) @throw [OFRemoveItemFailedException exceptionWithURL: URL errNo: errno]; @@ -1049,21 +1049,21 @@ #ifndef OF_AMIGAOS # ifndef OF_WINDOWS if (rmdir([path cStringWithEncoding: [OFLocale encoding]]) != 0) # else - if (_wrmdir([path UTF16String]) != 0) + if (_wrmdir(path.UTF16String) != 0) # endif @throw [OFRemoveItemFailedException exceptionWithURL: URL errNo: errno]; } else { # ifndef OF_WINDOWS if (unlink([path cStringWithEncoding: [OFLocale encoding]]) != 0) # else - if (_wunlink([path UTF16String]) != 0) + if (_wunlink(path.UTF16String) != 0) # endif @throw [OFRemoveItemFailedException exceptionWithURL: URL errNo: errno]; #endif @@ -1108,16 +1108,16 @@ OFString *sourcePath, *destinationPath; if (source == nil || destination == nil) @throw [OFInvalidArgumentException exception]; - if (![[source scheme] isEqual: _scheme] || - ![[destination scheme] isEqual: _scheme]) + if (![source.scheme isEqual: _scheme] || + ![destination.scheme isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; - sourcePath = [source fileSystemRepresentation]; - destinationPath = [destination fileSystemRepresentation]; + sourcePath = source.fileSystemRepresentation; + destinationPath = destination.fileSystemRepresentation; # ifndef OF_WINDOWS of_string_encoding_t encoding = [OFLocale encoding]; if (link([sourcePath cStringWithEncoding: encoding], @@ -1125,12 +1125,12 @@ @throw [OFLinkFailedException exceptionWithSourceURL: source destinationURL: destination errNo: errno]; # else - if (!CreateHardLinkW([destinationPath UTF16String], - [sourcePath UTF16String], NULL)) + if (!CreateHardLinkW(destinationPath.UTF16String, + sourcePath.UTF16String, NULL)) @throw [OFLinkFailedException exceptionWithSourceURL: source destinationURL: destination errNo: 0]; # endif @@ -1147,14 +1147,14 @@ OFString *path; if (URL == nil || target == nil) @throw [OFInvalidArgumentException exception]; - if (![[URL scheme] isEqual: _scheme]) + if (![URL.scheme isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; - path = [URL fileSystemRepresentation]; + path = URL.fileSystemRepresentation; # ifndef OF_WINDOWS of_string_encoding_t encoding = [OFLocale encoding]; if (symlink([target cStringWithEncoding: encoding], @@ -1166,12 +1166,11 @@ # else if (func_CreateSymbolicLinkW == NULL) @throw [OFNotImplementedException exceptionWithSelector: _cmd object: self]; - if (!func_CreateSymbolicLinkW([path UTF16String], - [target UTF16String], 0)) + if (!func_CreateSymbolicLinkW(path.UTF16String, target.UTF16String, 0)) @throw [OFCreateSymbolicLinkFailedException exceptionWithURL: URL target: target errNo: 0]; # endif @@ -1183,12 +1182,12 @@ - (bool)moveItemAtURL: (OFURL *)source toURL: (OFURL *)destination { void *pool; - if (![[source scheme] isEqual: _scheme] || - ![[destination scheme] isEqual: _scheme]) + if (![source.scheme isEqual: _scheme] || + ![destination.scheme isEqual: _scheme]) return false; if ([self fileExistsAtURL: destination]) @throw [OFMoveItemFailedException exceptionWithSourceURL: source @@ -1196,22 +1195,22 @@ errNo: EEXIST]; pool = objc_autoreleasePoolPush(); #if defined(OF_WINDOWS) - if (_wrename([[source fileSystemRepresentation] UTF16String], - [[destination fileSystemRepresentation] UTF16String]) != 0) + if (_wrename(source.fileSystemRepresentation.UTF16String, + destination.fileSystemRepresentation.UTF16String) != 0) @throw [OFMoveItemFailedException exceptionWithSourceURL: source destinationURL: destination errNo: errno]; #elif defined(OF_AMIGAOS) of_string_encoding_t encoding = [OFLocale encoding]; - if (!Rename([[source fileSystemRepresentation] + if (!Rename([source.fileSystemRepresentation cStringWithEncoding: encoding], - [[destination fileSystemRepresentation] + [destination.fileSystemRepresentation cStringWithEncoding: encoding])) { int errNo; switch (IoErr()) { case ERROR_RENAME_ACROSS_DEVICES: @@ -1241,13 +1240,13 @@ errNo: errNo]; } #else of_string_encoding_t encoding = [OFLocale encoding]; - if (rename([[source fileSystemRepresentation] + if (rename([source.fileSystemRepresentation cStringWithEncoding: encoding], - [[destination fileSystemRepresentation] + [destination.fileSystemRepresentation cStringWithEncoding: encoding]) != 0) @throw [OFMoveItemFailedException exceptionWithSourceURL: source destinationURL: destination errNo: errno];