ObjFW  Diff

Differences From Artifact [ff06e4c90e]:

To Artifact [08e4ea3058]:


304
305
306
307
308
309
310


311
312





313
314
315
316
317
318
319
304
305
306
307
308
309
310
311
312


313
314
315
316
317
318
319
320
321
322
323
324







+
+
-
-
+
+
+
+
+







	    IRIByAppendingPathComponent: @"source"];
	OFIRI *destinationIRI = [_testsDirectoryIRI
	    IRIByAppendingPathComponent: @"destination"];
	OFFileAttributes attributes;

	[@"test" writeToIRI: sourceIRI];

	@try {
		[_fileManager
	[_fileManager linkItemAtPath: sourceIRI.fileSystemRepresentation
			      toPath: destinationIRI.fileSystemRepresentation];
		    linkItemAtPath: sourceIRI.fileSystemRepresentation
			    toPath: destinationIRI.fileSystemRepresentation];
	} @catch (OFNotImplementedException *e) {
		OTSkip(@"Links not supported");
	}

	attributes = [_fileManager attributesOfItemAtIRI: destinationIRI];
	OTAssertEqual(attributes.fileType, OFFileTypeRegular);
	OTAssertEqual(attributes.fileSize, 4);
	OTAssertEqualObjects([OFString stringWithContentsOfIRI: destinationIRI],
	    @"test");
}
346
347
348
349
350
351
352


353
354
355
356
357
358
359
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366







+
+







	} @catch (OFCreateSymbolicLinkFailedException *e) {
		if (e.errNo != EPERM)
			@throw e;

		OTSkip(@"No permission to create symlink.\n"
		    @"On Windows, only the administrator can create symbolic "
		    @"links.");
	} @catch (OFNotImplementedException *e) {
		OTSkip(@"Symlinks not supported");
	}

	attributes = [_fileManager attributesOfItemAtIRI: destinationIRI];
	OTAssertEqual(attributes.fileType, OFFileTypeSymbolicLink);
	OTAssertEqualObjects([OFString stringWithContentsOfIRI: destinationIRI],
	    @"test");
}