720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
|
if (_overwrite == 1 ||
![[OFFileManager defaultManager] fileExistsAtPath: outFileName])
return true;
if (_overwrite == -1) {
if (_outputLevel >= 0) {
[OFStdOut writeString: @" "];
[OFStdOut writeLine:
OF_LOCALIZED(@"file_skipped", @"skipped")];
}
return false;
}
do {
[OFStdErr writeString: @"\r"];
|
|
|
|
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
|
if (_overwrite == 1 ||
![[OFFileManager defaultManager] fileExistsAtPath: outFileName])
return true;
if (_overwrite == -1) {
if (_outputLevel >= 0) {
[OFStdErr writeString: @" "];
[OFStdErr writeLine:
OF_LOCALIZED(@"file_skipped", @"skipped")];
}
return false;
}
do {
[OFStdErr writeString: @"\r"];
|
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
|
if ([line isEqual: @"A"])
_overwrite = 1;
else if ([line isEqual: @"N"])
_overwrite = -1;
if ([line isEqual: @"n"] || [line isEqual: @"N"]) {
if (_outputLevel >= 0)
[OFStdOut writeLine: OF_LOCALIZED(@"skipping_file",
@"Skipping %[file]...",
@"file", fileName)];
return false;
}
if (_outputLevel >= 0)
[OFStdOut writeString: OF_LOCALIZED(@"extracting_file",
@"Extracting %[file]...",
@"file", fileName)];
return true;
}
- (ssize_t)copyBlockFromStream: (OFStream *)input
toStream: (OFStream *)output
fileName: (OFString *)fileName
{
char buffer[bufferSize];
size_t length;
@try {
length = [input readIntoBuffer: buffer length: bufferSize];
} @catch (OFReadFailedException *e) {
[OFStdOut writeString: @"\r"];
[OFStdErr writeLine: OF_LOCALIZED(@"failed_to_read_file",
@"Failed to read file %[file]: %[error]",
@"file", fileName,
@"error", OFStrError(e.errNo))];
return -1;
}
@try {
[output writeBuffer: buffer length: length];
} @catch (OFWriteFailedException *e) {
[OFStdOut writeString: @"\r"];
[OFStdErr writeLine: OF_LOCALIZED(@"failed_to_write_file",
@"Failed to write file %[file]: %[error]",
@"file", fileName,
@"error", OFStrError(e.errNo))];
return -1;
}
|
|
|
|
|
|
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
|
if ([line isEqual: @"A"])
_overwrite = 1;
else if ([line isEqual: @"N"])
_overwrite = -1;
if ([line isEqual: @"n"] || [line isEqual: @"N"]) {
if (_outputLevel >= 0)
[OFStdErr writeLine: OF_LOCALIZED(@"skipping_file",
@"Skipping %[file]...",
@"file", fileName)];
return false;
}
if (_outputLevel >= 0)
[OFStdErr writeString: OF_LOCALIZED(@"extracting_file",
@"Extracting %[file]...",
@"file", fileName)];
return true;
}
- (ssize_t)copyBlockFromStream: (OFStream *)input
toStream: (OFStream *)output
fileName: (OFString *)fileName
{
char buffer[bufferSize];
size_t length;
@try {
length = [input readIntoBuffer: buffer length: bufferSize];
} @catch (OFReadFailedException *e) {
[OFStdErr writeString: @"\r"];
[OFStdErr writeLine: OF_LOCALIZED(@"failed_to_read_file",
@"Failed to read file %[file]: %[error]",
@"file", fileName,
@"error", OFStrError(e.errNo))];
return -1;
}
@try {
[output writeBuffer: buffer length: length];
} @catch (OFWriteFailedException *e) {
[OFStdErr writeString: @"\r"];
[OFStdErr writeLine: OF_LOCALIZED(@"failed_to_write_file",
@"Failed to write file %[file]: %[error]",
@"file", fileName,
@"error", OFStrError(e.errNo))];
return -1;
}
|