Differences From Artifact [f060fd2dab]:
- File
src/OFFile.m
— part of check-in
[d101b6f8b4]
at
2013-08-12 13:26:40
on branch trunk
— Fix OFSeekableStream.
-[seekToOffset:whence:] now works correctly when whence is SEEK_CUR.
Additionally, the new offset is returned now. (user: js, size: 17665) [annotate] [blame] [check-ins using]
To Artifact [e0f0d0594a]:
- File
src/OFFile.m
— part of check-in
[7c4179ab9b]
at
2013-08-14 19:17:10
on branch trunk
— +[stringWithPath:] -> +[pathWithComponents:].
This removes -[initWithPath:,...], so that it's finally possible to use
-[initWithPath:] for many places where a workaround like
-[initWithDirectoryPath:] was required before. (user: js, size: 17802) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
276 277 278 279 280 281 282 | pathComponents = [path pathComponents]; enumerator = [pathComponents objectEnumerator]; while ((component = [enumerator nextObject]) != nil) { void *pool2 = objc_autoreleasePoolPush(); if (currentPath != nil) | | | | 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | pathComponents = [path pathComponents]; enumerator = [pathComponents objectEnumerator]; while ((component = [enumerator nextObject]) != nil) { void *pool2 = objc_autoreleasePoolPush(); if (currentPath != nil) currentPath = [currentPath stringByAppendingPathComponent: component]; else currentPath = component; if ([currentPath length] > 0 && ![OFFile directoryExistsAtPath: currentPath]) [OFFile createDirectoryAtPath: currentPath]; |
︙ | ︙ | |||
521 522 523 524 525 526 527 | if (source == nil || destination == nil) @throw [OFInvalidArgumentException exception]; pool = objc_autoreleasePoolPush(); if ([self directoryExistsAtPath: destination]) { | > | | < | 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 | if (source == nil || destination == nil) @throw [OFInvalidArgumentException exception]; pool = objc_autoreleasePoolPush(); if ([self directoryExistsAtPath: destination]) { OFArray *components = [OFArray arrayWithObjects: destination, [source lastPathComponent], nil]; destination = [OFString pathWithComponents: components]; } override = [self fileExistsAtPath: destination]; pageSize = [OFSystemInfo pageSize]; if ((buffer = malloc(pageSize)) == NULL) @throw [OFOutOfMemoryException |
︙ | ︙ | |||
579 580 581 582 583 584 585 | if (source == nil || destination == nil) @throw [OFInvalidArgumentException exception]; pool = objc_autoreleasePoolPush(); if ([self directoryExistsAtPath: destination]) { | > | | < | 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 | if (source == nil || destination == nil) @throw [OFInvalidArgumentException exception]; pool = objc_autoreleasePoolPush(); if ([self directoryExistsAtPath: destination]) { OFArray *components = [OFArray arrayWithObjects: destination, [source lastPathComponent], nil]; destination = [OFString pathWithComponents: components]; } #ifndef _WIN32 if (rename([source cStringWithEncoding: OF_STRING_ENCODING_NATIVE], [destination cStringWithEncoding: OF_STRING_ENCODING_NATIVE])) #else if (_wrename([source UTF16String], [destination UTF16String])) |
︙ | ︙ | |||
623 624 625 626 627 628 629 | if (source == nil || destination == nil) @throw [OFInvalidArgumentException exception]; pool = objc_autoreleasePoolPush(); if ([self directoryExistsAtPath: destination]) { | > | | < | 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 | if (source == nil || destination == nil) @throw [OFInvalidArgumentException exception]; pool = objc_autoreleasePoolPush(); if ([self directoryExistsAtPath: destination]) { OFArray *components = [OFArray arrayWithObjects: destination, [source lastPathComponent], nil]; destination = [OFString pathWithComponents: components]; } if (link([source cStringWithEncoding: OF_STRING_ENCODING_NATIVE], [destination cStringWithEncoding: OF_STRING_ENCODING_NATIVE]) != 0) @throw [OFLinkFailedException exceptionWithSourcePath: source destinationPath: destination]; |
︙ | ︙ | |||
650 651 652 653 654 655 656 | if (source == nil || destination == nil) @throw [OFInvalidArgumentException exception]; pool = objc_autoreleasePoolPush(); if ([self directoryExistsAtPath: destination]) { | > | | < | 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 | if (source == nil || destination == nil) @throw [OFInvalidArgumentException exception]; pool = objc_autoreleasePoolPush(); if ([self directoryExistsAtPath: destination]) { OFArray *components = [OFArray arrayWithObjects: destination, [source lastPathComponent], nil]; destination = [OFString pathWithComponents: components]; } if (symlink([source cStringWithEncoding: OF_STRING_ENCODING_NATIVE], [destination cStringWithEncoding: OF_STRING_ENCODING_NATIVE]) != 0) @throw [OFCreateSymbolicLinkFailedException exceptionWithSourcePath: source destinationPath: destination]; |
︙ | ︙ |