@@ -39,19 +39,19 @@ #endif #ifdef HAVE_GRP_H # include #endif -#import "OFFileURIHandler.h" +#import "OFFileIRIHandler.h" #import "OFArray.h" #import "OFDate.h" #import "OFFile.h" #import "OFFileManager.h" +#import "OFIRI.h" #import "OFLocale.h" #import "OFNumber.h" #import "OFSystemInfo.h" -#import "OFURI.h" #ifdef OF_HAVE_THREADS # import "OFMutex.h" #endif @@ -455,13 +455,13 @@ } #ifdef OF_FILE_MANAGER_SUPPORTS_SYMLINKS static void setSymbolicLinkDestinationAttribute(OFMutableFileAttributes attributes, - OFURI *URI) + OFIRI *IRI) { - OFString *path = URI.fileSystemRepresentation; + OFString *path = IRI.fileSystemRepresentation; # ifndef OF_WINDOWS OFStringEncoding encoding = [OFLocale encoding]; char destinationC[PATH_MAX]; ssize_t length; OFString *destination; @@ -469,11 +469,11 @@ length = readlink([path cStringWithEncoding: encoding], destinationC, PATH_MAX); if (length < 0) @throw [OFGetItemAttributesFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI errNo: errno]; destination = [OFString stringWithCString: destinationC encoding: encoding length: length]; @@ -489,11 +489,11 @@ 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 [OFGetItemAttributesFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI errNo: lastError()]; @try { union { char bytes[MAXIMUM_REPARSE_DATA_BUFFER_SIZE]; @@ -504,16 +504,16 @@ if (!DeviceIoControl(handle, FSCTL_GET_REPARSE_POINT, NULL, 0, buffer.bytes, MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &size, NULL)) @throw [OFGetItemAttributesFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI errNo: lastError()]; if (buffer.data.ReparseTag != IO_REPARSE_TAG_SYMLINK) @throw [OFGetItemAttributesFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI errNo: lastError()]; # define slrb buffer.data.SymbolicLinkReparseBuffer tmp = slrb.PathBuffer + (slrb.SubstituteNameOffset / sizeof(wchar_t)); @@ -533,18 +533,18 @@ } # endif } #endif -@implementation OFFileURIHandler +@implementation OFFileIRIHandler + (void)initialize { #ifdef OF_WINDOWS HMODULE module; #endif - if (self != [OFFileURIHandler class]) + if (self != [OFFileIRIHandler class]) return; #if defined(OF_FILE_MANAGER_SUPPORTS_OWNER) && defined(OF_HAVE_THREADS) passwdMutex = [[OFMutex alloc] init]; atexit(releasePasswdMutex); @@ -585,41 +585,41 @@ return false; return S_ISDIR(s.st_mode); } -- (OFStream *)openItemAtURI: (OFURI *)URI mode: (OFString *)mode +- (OFStream *)openItemAtIRI: (OFIRI *)IRI mode: (OFString *)mode { void *pool = objc_autoreleasePoolPush(); OFFile *file = [[OFFile alloc] - initWithPath: URI.fileSystemRepresentation + initWithPath: IRI.fileSystemRepresentation mode: mode]; objc_autoreleasePoolPop(pool); return [file autorelease]; } -- (OFFileAttributes)attributesOfItemAtURI: (OFURI *)URI +- (OFFileAttributes)attributesOfItemAtIRI: (OFIRI *)IRI { OFMutableFileAttributes ret = [OFMutableDictionary dictionary]; void *pool = objc_autoreleasePoolPush(); OFString *path; int error; Stat s; - if (URI == nil) + if (IRI == nil) @throw [OFInvalidArgumentException exception]; - if (![[URI scheme] isEqual: _scheme]) + if (![[IRI scheme] isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; - path = URI.fileSystemRepresentation; + path = IRI.fileSystemRepresentation; if ((error = lstatWrapper(path, &s)) != 0) @throw [OFGetItemAttributesFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI errNo: error]; if (s.st_size < 0) @throw [OFOutOfRangeException exception]; @@ -634,24 +634,24 @@ setOwnerAndGroupAttributes(ret, &s); setDateAttributes(ret, &s); #ifdef OF_FILE_MANAGER_SUPPORTS_SYMLINKS if (S_ISLNK(s.st_mode)) - setSymbolicLinkDestinationAttribute(ret, URI); + setSymbolicLinkDestinationAttribute(ret, IRI); #endif objc_autoreleasePoolPop(pool); return ret; } - (void)of_setLastAccessDate: (OFDate *)lastAccessDate andModificationDate: (OFDate *)modificationDate - ofItemAtURI: (OFURI *)URI + ofItemAtIRI: (OFIRI *)IRI attributes: (OFFileAttributes)attributes OF_DIRECT { - OFString *path = URI.fileSystemRepresentation; + OFString *path = IRI.fileSystemRepresentation; OFFileAttributeKey attributeKey = (modificationDate != nil ? OFFileModificationDate : OFFileLastAccessDate); if (lastAccessDate == nil) lastAccessDate = modificationDate; @@ -667,11 +667,11 @@ (__time64_t)modificationDate.timeIntervalSince1970 }; if (_wutime64FuncPtr([path UTF16String], ×) != 0) @throw [OFSetItemAttributesFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI attributes: attributes failedAttribute: attributeKey errNo: errno]; } else { struct _utimbuf times = { @@ -688,11 +688,11 @@ [path cStringWithEncoding: [OFLocale encoding]], ×); if (status != 0) @throw [OFSetItemAttributesFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI attributes: attributes failedAttribute: attributeKey errNo: errno]; } #elif defined(OF_AMIGAOS) @@ -726,11 +726,11 @@ # else if (!SetFileDate([path cStringWithEncoding: [OFLocale encoding]], &date) != 0) # endif @throw [OFSetItemAttributesFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI attributes: attributes failedAttribute: attributeKey errNo: lastError()]; #else OFTimeInterval lastAccessTime = lastAccessDate.timeIntervalSince1970; @@ -749,24 +749,24 @@ }, }; if (utimes([path cStringWithEncoding: [OFLocale encoding]], times) != 0) @throw [OFSetItemAttributesFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI attributes: attributes failedAttribute: attributeKey errNo: errno]; #endif } - (void)of_setPOSIXPermissions: (OFNumber *)permissions - ofItemAtURI: (OFURI *)URI + ofItemAtIRI: (OFIRI *)IRI attributes: (OFFileAttributes)attributes OF_DIRECT { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS mode_t mode = (mode_t)permissions.unsignedLongValue; - OFString *path = URI.fileSystemRepresentation; + OFString *path = IRI.fileSystemRepresentation; int status; # ifdef OF_WINDOWS if ([OFSystemInfo isWindowsNT]) status = _wchmod(path.UTF16String, mode); @@ -775,11 +775,11 @@ status = chmod( [path cStringWithEncoding: [OFLocale encoding]], mode); if (status != 0) @throw [OFSetItemAttributesFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI attributes: attributes failedAttribute: OFFilePOSIXPermissions errNo: errno]; #else OF_UNRECOGNIZED_SELECTOR @@ -786,16 +786,16 @@ #endif } - (void)of_setOwnerAccountName: (OFString *)owner andGroupOwnerAccountName: (OFString *)group - ofItemAtURI: (OFURI *)URI + ofItemAtIRI: (OFIRI *)IRI attributeKey: (OFFileAttributeKey)attributeKey attributes: (OFFileAttributes)attributes OF_DIRECT { #ifdef OF_FILE_MANAGER_SUPPORTS_OWNER - OFString *path = URI.fileSystemRepresentation; + OFString *path = IRI.fileSystemRepresentation; uid_t uid = -1; gid_t gid = -1; OFStringEncoding encoding; if (owner == nil && group == nil) @@ -811,11 +811,11 @@ struct passwd *passwd; if ((passwd = getpwnam([owner cStringWithEncoding: encoding])) == NULL) @throw [OFSetItemAttributesFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI attributes: attributes failedAttribute: attributeKey errNo: errno]; uid = passwd->pw_uid; @@ -825,11 +825,11 @@ struct group *group_; if ((group_ = getgrnam([group cStringWithEncoding: encoding])) == NULL) @throw [OFSetItemAttributesFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI attributes: attributes failedAttribute: attributeKey errNo: errno]; gid = group_->gr_gid; @@ -840,32 +840,32 @@ } # endif if (chown([path cStringWithEncoding: encoding], uid, gid) != 0) @throw [OFSetItemAttributesFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI attributes: attributes failedAttribute: attributeKey errNo: errno]; #else OF_UNRECOGNIZED_SELECTOR #endif } -- (void)setAttributes: (OFFileAttributes)attributes ofItemAtURI: (OFURI *)URI +- (void)setAttributes: (OFFileAttributes)attributes ofItemAtIRI: (OFIRI *)IRI { void *pool = objc_autoreleasePoolPush(); OFEnumerator OF_GENERIC(OFFileAttributeKey) *keyEnumerator; OFEnumerator *objectEnumerator; OFFileAttributeKey key; id object; OFDate *lastAccessDate, *modificationDate; - if (URI == nil) + if (IRI == nil) @throw [OFInvalidArgumentException exception]; - if (![URI.scheme isEqual: _scheme]) + if (![IRI.scheme isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; keyEnumerator = [attributes keyEnumerator]; objectEnumerator = [attributes objectEnumerator]; @@ -874,22 +874,22 @@ if ([key isEqual: OFFileModificationDate] || [key isEqual: OFFileLastAccessDate]) continue; else if ([key isEqual: OFFilePOSIXPermissions]) [self of_setPOSIXPermissions: object - ofItemAtURI: URI + ofItemAtIRI: IRI attributes: attributes]; else if ([key isEqual: OFFileOwnerAccountName]) [self of_setOwnerAccountName: object andGroupOwnerAccountName: nil - ofItemAtURI: URI + ofItemAtIRI: IRI attributeKey: key attributes: attributes]; else if ([key isEqual: OFFileGroupOwnerAccountName]) [self of_setOwnerAccountName: nil andGroupOwnerAccountName: object - ofItemAtURI: URI + ofItemAtIRI: IRI attributeKey: key attributes: attributes]; else @throw [OFNotImplementedException exceptionWithSelector: _cmd @@ -900,29 +900,29 @@ modificationDate = [attributes objectForKey: OFFileModificationDate]; if (lastAccessDate != nil || modificationDate != nil) [self of_setLastAccessDate: lastAccessDate andModificationDate: modificationDate - ofItemAtURI: URI + ofItemAtIRI: IRI attributes: attributes]; objc_autoreleasePoolPop(pool); } -- (bool)fileExistsAtURI: (OFURI *)URI +- (bool)fileExistsAtIRI: (OFIRI *)IRI { void *pool = objc_autoreleasePoolPush(); Stat s; bool ret; - if (URI == nil) + if (IRI == nil) @throw [OFInvalidArgumentException exception]; - if (![URI.scheme isEqual: _scheme]) + if (![IRI.scheme isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; - if (statWrapper(URI.fileSystemRepresentation, &s) != 0) { + if (statWrapper(IRI.fileSystemRepresentation, &s) != 0) { objc_autoreleasePoolPop(pool); return false; } ret = S_ISREG(s.st_mode); @@ -930,23 +930,23 @@ objc_autoreleasePoolPop(pool); return ret; } -- (bool)directoryExistsAtURI: (OFURI *)URI +- (bool)directoryExistsAtIRI: (OFIRI *)IRI { void *pool = objc_autoreleasePoolPush(); Stat s; bool ret; - if (URI == nil) + if (IRI == nil) @throw [OFInvalidArgumentException exception]; - if (![URI.scheme isEqual: _scheme]) + if (![IRI.scheme isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; - if (statWrapper(URI.fileSystemRepresentation, &s) != 0) { + if (statWrapper(IRI.fileSystemRepresentation, &s) != 0) { objc_autoreleasePoolPop(pool); return false; } ret = S_ISDIR(s.st_mode); @@ -954,22 +954,22 @@ objc_autoreleasePoolPop(pool); return ret; } -- (void)createDirectoryAtURI: (OFURI *)URI +- (void)createDirectoryAtIRI: (OFIRI *)IRI { void *pool = objc_autoreleasePoolPush(); OFString *path; - if (URI == nil) + if (IRI == nil) @throw [OFInvalidArgumentException exception]; - if (![URI.scheme isEqual: _scheme]) + if (![IRI.scheme isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; - path = URI.fileSystemRepresentation; + path = IRI.fileSystemRepresentation; #if defined(OF_WINDOWS) int status; if ([OFSystemInfo isWindowsNT]) @@ -978,45 +978,45 @@ status = _mkdir( [path cStringWithEncoding: [OFLocale encoding]]); if (status != 0) @throw [OFCreateDirectoryFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI errNo: errno]; #elif defined(OF_AMIGAOS) BPTR lock; if ((lock = CreateDir( [path cStringWithEncoding: [OFLocale encoding]])) == 0) @throw [OFCreateDirectoryFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI errNo: lastError()]; UnLock(lock); #else if (mkdir([path cStringWithEncoding: [OFLocale encoding]], 0777) != 0) @throw [OFCreateDirectoryFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI errNo: errno]; #endif objc_autoreleasePoolPop(pool); } -- (OFArray OF_GENERIC(OFURI *) *)contentsOfDirectoryAtURI: (OFURI *)URI +- (OFArray OF_GENERIC(OFIRI *) *)contentsOfDirectoryAtIRI: (OFIRI *)IRI { - OFMutableArray *URIs = [OFMutableArray array]; + OFMutableArray *IRIs = [OFMutableArray array]; void *pool = objc_autoreleasePoolPush(); OFString *path; - if (URI == nil) + if (IRI == nil) @throw [OFInvalidArgumentException exception]; - if (![URI.scheme isEqual: _scheme]) + if (![IRI.scheme isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; - path = URI.fileSystemRepresentation; + path = IRI.fileSystemRepresentation; #if defined(OF_WINDOWS) HANDLE handle; path = [path stringByAppendingString: @"\\*"]; @@ -1025,11 +1025,11 @@ WIN32_FIND_DATAW fd; if ((handle = FindFirstFileW(path.UTF16String, &fd)) == INVALID_HANDLE_VALUE) @throw [OFOpenItemFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI mode: nil errNo: lastError()]; @try { do { @@ -1040,12 +1040,12 @@ continue; file = [[OFString alloc] initWithUTF16String: fd.cFileName]; @try { - [URIs addObject: [URI - URIByAppendingPathComponent: file]]; + [IRIs addObject: [IRI + IRIByAppendingPathComponent: file]]; } @finally { [file release]; } } while (FindNextFileW(handle, &fd)); @@ -1063,11 +1063,11 @@ if ((handle = FindFirstFileA( [path cStringWithEncoding: encoding], &fd)) == INVALID_HANDLE_VALUE) @throw [OFOpenItemFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI mode: nil errNo: lastError()]; @try { do { @@ -1079,12 +1079,12 @@ file = [[OFString alloc] initWithCString: fd.cFileName encoding: encoding]; @try { - [URIs addObject: [URI - URIByAppendingPathComponent: file]]; + [IRIs addObject: [IRI + IRIByAppendingPathComponent: file]]; } @finally { [file release]; } } while (FindNextFileA(handle, &fd)); @@ -1102,11 +1102,11 @@ BPTR lock; if ((lock = Lock([path cStringWithEncoding: encoding], SHARED_LOCK)) == 0) @throw [OFOpenItemFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI mode: nil errNo: lastError()]; @try { # ifdef OF_AMIGAOS4 @@ -1115,11 +1115,11 @@ if ((context = ObtainDirContextTags(EX_FileLockInput, lock, EX_DoCurrentDir, TRUE, EX_DataFields, EXF_NAME, TAG_END)) == NULL) @throw [OFOpenItemFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI mode: nil errNo: lastError()]; @try { while ((ed = ExamineDir(context)) != NULL) { @@ -1126,12 +1126,12 @@ OFString *file = [[OFString alloc] initWithCString: ed->Name encoding: encoding]; @try { - [URIs addObject: [URI - URIByAppendingPathComponent: file]]; + [IRIs addObject: [IRI + IRIByAppendingPathComponent: file]]; } @finally { [file release]; } } } @finally { @@ -1140,21 +1140,21 @@ # else struct FileInfoBlock fib; if (!Examine(lock, &fib)) @throw [OFOpenItemFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI mode: nil errNo: lastError()]; while (ExNext(lock, &fib)) { OFString *file = [[OFString alloc] initWithCString: fib.fib_FileName encoding: encoding]; @try { - [URIs addObject: - [URI URIByAppendingPathComponent: file]]; + [IRIs addObject: + [IRI IRIByAppendingPathComponent: file]]; } @finally { [file release]; } } # endif @@ -1169,11 +1169,11 @@ } #else OFStringEncoding encoding = [OFLocale encoding]; DIR *dir; if ((dir = opendir([path cStringWithEncoding: encoding])) == NULL) - @throw [OFOpenItemFailedException exceptionWithURI: URI + @throw [OFOpenItemFailedException exceptionWithIRI: IRI mode: nil errNo: errno]; # if !defined(HAVE_READDIR_R) && defined(OF_HAVE_THREADS) @try { @@ -1219,12 +1219,12 @@ continue; file = [[OFString alloc] initWithCString: dirent->d_name encoding: encoding]; @try { - [URIs addObject: - [URI URIByAppendingPathComponent: file]]; + [IRIs addObject: + [IRI IRIByAppendingPathComponent: file]]; } @finally { [file release]; } } } @finally { @@ -1233,41 +1233,41 @@ [readdirMutex unlock]; # endif } #endif - [URIs makeImmutable]; + [IRIs makeImmutable]; objc_autoreleasePoolPop(pool); - return URIs; + return IRIs; } -- (void)removeItemAtURI: (OFURI *)URI +- (void)removeItemAtIRI: (OFIRI *)IRI { void *pool = objc_autoreleasePoolPush(); OFString *path; int error; Stat s; - if (URI == nil) + if (IRI == nil) @throw [OFInvalidArgumentException exception]; - if (![URI.scheme isEqual: _scheme]) + if (![IRI.scheme isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; - path = URI.fileSystemRepresentation; + path = IRI.fileSystemRepresentation; if ((error = lstatWrapper(path, &s)) != 0) - @throw [OFRemoveItemFailedException exceptionWithURI: URI + @throw [OFRemoveItemFailedException exceptionWithIRI: IRI errNo: error]; if (S_ISDIR(s.st_mode)) { - OFArray OF_GENERIC(OFURI *) *contents; + OFArray OF_GENERIC(OFIRI *) *contents; @try { - contents = [self contentsOfDirectoryAtURI: URI]; + contents = [self contentsOfDirectoryAtIRI: IRI]; } @catch (id e) { /* * Only convert exceptions to * OFRemoveItemFailedException that have an errNo * property. This covers all I/O related exceptions @@ -1274,20 +1274,20 @@ * from the operations used to remove an item, all * others should be left as is. */ if ([e respondsToSelector: @selector(errNo)]) @throw [OFRemoveItemFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI errNo: [e errNo]]; @throw e; } - for (OFURI *item in contents) { + for (OFIRI *item in contents) { void *pool2 = objc_autoreleasePoolPush(); - [self removeItemAtURI: item]; + [self removeItemAtIRI: item]; objc_autoreleasePoolPop(pool2); } #ifndef OF_AMIGAOS @@ -1301,11 +1301,11 @@ status = rmdir( [path cStringWithEncoding: [OFLocale encoding]]); if (status != 0) @throw [OFRemoveItemFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI errNo: errno]; } else { int status; # ifdef OF_WINDOWS @@ -1316,27 +1316,27 @@ status = unlink( [path cStringWithEncoding: [OFLocale encoding]]); if (status != 0) @throw [OFRemoveItemFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI errNo: errno]; #endif } #ifdef OF_AMIGAOS if (!DeleteFile([path cStringWithEncoding: [OFLocale encoding]])) @throw [OFRemoveItemFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI errNo: lastError()]; #endif objc_autoreleasePoolPop(pool); } #ifdef OF_FILE_MANAGER_SUPPORTS_LINKS -- (void)linkItemAtURI: (OFURI *)source toURI: (OFURI *)destination +- (void)linkItemAtIRI: (OFIRI *)source toIRI: (OFIRI *)destination { void *pool = objc_autoreleasePoolPush(); OFString *sourcePath, *destinationPath; if (source == nil || destination == nil) @@ -1353,52 +1353,52 @@ OFStringEncoding encoding = [OFLocale encoding]; if (link([sourcePath cStringWithEncoding: encoding], [destinationPath cStringWithEncoding: encoding]) != 0) @throw [OFLinkItemFailedException - exceptionWithSourceURI: source - destinationURI: destination + exceptionWithSourceIRI: source + destinationIRI: destination errNo: errno]; # else if (createHardLinkWFuncPtr == NULL) @throw [OFNotImplementedException exceptionWithSelector: _cmd object: self]; if (!createHardLinkWFuncPtr(destinationPath.UTF16String, sourcePath.UTF16String, NULL)) @throw [OFLinkItemFailedException - exceptionWithSourceURI: source - destinationURI: destination + exceptionWithSourceIRI: source + destinationIRI: destination errNo: lastError()]; # endif objc_autoreleasePoolPop(pool); } #endif #ifdef OF_FILE_MANAGER_SUPPORTS_SYMLINKS -- (void)createSymbolicLinkAtURI: (OFURI *)URI +- (void)createSymbolicLinkAtIRI: (OFIRI *)IRI withDestinationPath: (OFString *)target { void *pool = objc_autoreleasePoolPush(); OFString *path; - if (URI == nil || target == nil) + if (IRI == nil || target == nil) @throw [OFInvalidArgumentException exception]; - if (![URI.scheme isEqual: _scheme]) + if (![IRI.scheme isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; - path = URI.fileSystemRepresentation; + path = IRI.fileSystemRepresentation; # ifndef OF_WINDOWS OFStringEncoding encoding = [OFLocale encoding]; if (symlink([target cStringWithEncoding: encoding], [path cStringWithEncoding: encoding]) != 0) @throw [OFCreateSymbolicLinkFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI target: target errNo: errno]; # else if (createSymbolicLinkWFuncPtr == NULL) @throw [OFNotImplementedException exceptionWithSelector: _cmd @@ -1405,31 +1405,31 @@ object: self]; if (!createSymbolicLinkWFuncPtr(path.UTF16String, target.UTF16String, 0)) @throw [OFCreateSymbolicLinkFailedException - exceptionWithURI: URI + exceptionWithIRI: IRI target: target errNo: lastError()]; # endif objc_autoreleasePoolPop(pool); } #endif -- (bool)moveItemAtURI: (OFURI *)source toURI: (OFURI *)destination +- (bool)moveItemAtIRI: (OFIRI *)source toIRI: (OFIRI *)destination { void *pool; if (![source.scheme isEqual: _scheme] || ![destination.scheme isEqual: _scheme]) return false; - if ([self fileExistsAtURI: destination]) + if ([self fileExistsAtIRI: destination]) @throw [OFMoveItemFailedException - exceptionWithSourceURI: source - destinationURI: destination + exceptionWithSourceIRI: source + destinationIRI: destination errNo: EEXIST]; pool = objc_autoreleasePoolPush(); #ifdef OF_AMIGAOS @@ -1438,12 +1438,12 @@ if (!Rename([source.fileSystemRepresentation cStringWithEncoding: encoding], [destination.fileSystemRepresentation cStringWithEncoding: encoding])) @throw [OFMoveItemFailedException - exceptionWithSourceURI: source - destinationURI: destination + exceptionWithSourceIRI: source + destinationIRI: destination errNo: lastError()]; #else int status; # ifdef OF_WINDOWS @@ -1462,15 +1462,15 @@ } # endif if (status != 0) @throw [OFMoveItemFailedException - exceptionWithSourceURI: source - destinationURI: destination + exceptionWithSourceIRI: source + destinationIRI: destination errNo: errno]; #endif objc_autoreleasePoolPop(pool); return true; } @end