@@ -1010,13 +1010,13 @@ #endif objc_autoreleasePoolPop(pool); } -- (OFArray OF_GENERIC(OFString *) *)contentsOfDirectoryAtURL: (OFURL *)URL +- (OFArray OF_GENERIC(OFURL *) *)contentsOfDirectoryAtURL: (OFURL *)URL { - OFMutableArray *files = [OFMutableArray array]; + OFMutableArray *URLs = [OFMutableArray array]; void *pool = objc_autoreleasePoolPush(); OFString *path; if (URL == nil) @throw [OFInvalidArgumentException exception]; @@ -1050,11 +1050,12 @@ continue; file = [[OFString alloc] initWithUTF16String: fd.cFileName]; @try { - [files addObject: file]; + [URLs addObject: [URL + URLByAppendingPathComponent: file]]; } @finally { [file release]; } } while (FindNextFileW(handle, &fd)); @@ -1088,11 +1089,12 @@ file = [[OFString alloc] initWithCString: fd.cFileName encoding: encoding]; @try { - [files addObject: file]; + [URLs addObject: [URL + URLByAppendingPathComponent: file]]; } @finally { [file release]; } } while (FindNextFileA(handle, &fd)); @@ -1134,11 +1136,12 @@ OFString *file = [[OFString alloc] initWithCString: ed->Name encoding: encoding]; @try { - [files addObject: file]; + [URLs addObject: [URL + URLByAppendingPathComponent: file]]; } @finally { [file release]; } } } @finally { @@ -1156,11 +1159,12 @@ while (ExNext(lock, &fib)) { OFString *file = [[OFString alloc] initWithCString: fib.fib_FileName encoding: encoding]; @try { - [files addObject: file]; + [URLs addObject: + [URL URLByAppendingPathComponent: file]]; } @finally { [file release]; } } # endif @@ -1225,11 +1229,12 @@ continue; file = [[OFString alloc] initWithCString: dirent->d_name encoding: encoding]; @try { - [files addObject: file]; + [URLs addObject: + [URL URLByAppendingPathComponent: file]]; } @finally { [file release]; } } } @finally { @@ -1238,15 +1243,15 @@ [readdirMutex unlock]; # endif } #endif - [files makeImmutable]; + [URLs makeImmutable]; objc_autoreleasePoolPop(pool); - return files; + return URLs; } - (void)removeItemAtURL: (OFURL *)URL { void *pool = objc_autoreleasePoolPush(); @@ -1265,11 +1270,11 @@ if ((error = of_lstat(path, &s)) != 0) @throw [OFRemoveItemFailedException exceptionWithURL: URL errNo: error]; if (S_ISDIR(s.st_mode)) { - OFArray *contents; + OFArray OF_GENERIC(OFURL *) *contents; @try { contents = [self contentsOfDirectoryAtURL: URL]; } @catch (id e) { /* @@ -1285,15 +1290,14 @@ errNo: [e errNo]]; @throw e; } - for (OFString *item in contents) { + for (OFURL *item in contents) { void *pool2 = objc_autoreleasePoolPush(); - [self removeItemAtURL: [OFURL fileURLWithPath: - [path stringByAppendingPathComponent: item]]]; + [self removeItemAtURL: item]; objc_autoreleasePoolPop(pool2); } #ifndef OF_AMIGAOS