ObjFW  Diff

Differences From Artifact [afd967dd04]:

To Artifact [61dea202f4]:


330
331
332
333
334
335
336
337


338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359

360
361
362






363
364
365
366
367
368
369
		OFString *sourcePath = sourceIRI.fileSystemRepresentation;
		OFString *destinationPath =
		    destinationIRI.fileSystemRepresentation;

		[_fileManager createSymbolicLinkAtPath: destinationPath
				   withDestinationPath: sourcePath];
	} @catch (OFCreateSymbolicLinkFailedException *e) {
		if (e.errNo == EPERM)


			OTSkip(@"No permission to create symlink.\n"
			    @"On Windows, only the administrator can create "
			    @"symbolic links.");
		else
			@throw e;
	}

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

#ifdef OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES
- (void)testExtendedAttributes
{
	OFData *data = [OFData dataWithItems: "test" count: 4];
	OFString *testFilePath = _testFileIRI.fileSystemRepresentation;
	OFFileAttributes attributes;
	OFArray *extendedAttributeNames;


	[_fileManager setExtendedAttributeData: data
				       forName: @"user.test"
				  ofItemAtPath: testFilePath];







	attributes = [_fileManager attributesOfItemAtIRI: _testFileIRI];
	extendedAttributeNames =
	    [attributes objectForKey: OFFileExtendedAttributesNames];
	OTAssertNotNil(extendedAttributeNames);
	OTAssertTrue([extendedAttributeNames containsObject: @"user.test"]);
	OTAssertEqualObjects(







|
>
>
|
|
|
<
<

















>
|
|
|
>
>
>
>
>
>







330
331
332
333
334
335
336
337
338
339
340
341
342


343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
		OFString *sourcePath = sourceIRI.fileSystemRepresentation;
		OFString *destinationPath =
		    destinationIRI.fileSystemRepresentation;

		[_fileManager createSymbolicLinkAtPath: destinationPath
				   withDestinationPath: sourcePath];
	} @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.");


	}

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

#ifdef OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES
- (void)testExtendedAttributes
{
	OFData *data = [OFData dataWithItems: "test" count: 4];
	OFString *testFilePath = _testFileIRI.fileSystemRepresentation;
	OFFileAttributes attributes;
	OFArray *extendedAttributeNames;

	@try {
		[_fileManager setExtendedAttributeData: data
					       forName: @"user.test"
					  ofItemAtPath: testFilePath];
	} @catch (OFSetItemAttributesFailedException *e) {
		if (e.errNo != ENOTSUP)
			@throw e;

		OTSkip(@"Extended attributes are not supported");
	}

	attributes = [_fileManager attributesOfItemAtIRI: _testFileIRI];
	extendedAttributeNames =
	    [attributes objectForKey: OFFileExtendedAttributesNames];
	OTAssertNotNil(extendedAttributeNames);
	OTAssertTrue([extendedAttributeNames containsObject: @"user.test"]);
	OTAssertEqualObjects(