ObjFW  Diff

Differences From Artifact [eb89655310]:

To Artifact [5c5bcb3795]:


530
531
532
533
534
535
536


537
538
539
540
541
542
543
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545







+
+







		case 'p':
		case 'x':
			file = OFStdIn;
			break;
		default:
			@throw [OFInvalidArgumentException exception];
		}

		path = nil;
	} else {
		@try {
			file = [OFFile fileWithPath: path mode: fileModeString];
		} @catch (OFOpenItemFailedException *e) {
			OFString *error = [OFString
			    stringWithCString: strerror(e.errNo)
				     encoding: [OFLocale encoding]];
564
565
566
567
568
569
570
571
572
573




574
575
576
577




578
579
580
581




582
583
584
585
586
587
588




589
590
591
592




593
594
595
596
597
598
599
566
567
568
569
570
571
572



573
574
575
576
577



578
579
580
581
582



583
584
585
586
587
588
589
590



591
592
593
594
595



596
597
598
599
600
601
602
603
604
605
606







-
-
-
+
+
+
+

-
-
-
+
+
+
+

-
-
-
+
+
+
+




-
-
-
+
+
+
+

-
-
-
+
+
+
+







			type = @"tar";
		else
			type = @"zip";
	}

	@try {
		if ([type isEqual: @"gz"])
			archive = [GZIPArchive archiveWithStream: file
							    mode: modeString
							encoding: encoding];
			archive = [GZIPArchive archiveWithPath: path
							stream: file
							  mode: modeString
						      encoding: encoding];
		else if ([type isEqual: @"lha"])
			archive = [LHAArchive archiveWithStream: file
							   mode: modeString
						       encoding: encoding];
			 archive = [LHAArchive archiveWithPath: path
							stream: file
							  mode: modeString
						      encoding: encoding];
		else if ([type isEqual: @"tar"])
			archive = [TarArchive archiveWithStream: file
							   mode: modeString
						       encoding: encoding];
			archive = [TarArchive archiveWithPath: path
						       stream: file
							 mode: modeString
						     encoding: encoding];
		else if ([type isEqual: @"tgz"]) {
			OFStream *GZIPStream = [OFGZIPStream
			    streamWithStream: file
					mode: modeString];
			archive = [TarArchive archiveWithStream: GZIPStream
							   mode: modeString
						       encoding: encoding];
			archive = [TarArchive archiveWithPath: path
						       stream: GZIPStream
							 mode: modeString
						     encoding: encoding];
		} else if ([type isEqual: @"zip"])
			archive = [ZIPArchive archiveWithStream: file
							   mode: modeString
						       encoding: encoding];
			archive = [ZIPArchive archiveWithPath: path
						       stream: file
							 mode: modeString
						     encoding: encoding];
		else {
			[OFStdErr writeLine: OF_LOCALIZED(
			    @"unknown_archive_type",
			    @"Unknown archive type: %[type]",
			    @"type", type)];
			goto error;
		}