162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
{ 'q', @"quiet", 0, NULL, NULL },
{ 't', @"type", 1, NULL, &type },
{ 'v', @"verbose", 0, NULL, NULL },
{ 'x', @"extract", 0, NULL, NULL },
{ '\0', nil, 0, NULL, NULL }
};
OFUnichar option, mode = '\0';
of_string_encoding_t encoding = OF_STRING_ENCODING_AUTODETECT;
OFOptionsParser *optionsParser;
OFArray OF_GENERIC(OFString *) *remainingArguments, *files;
id <Archive> archive;
#ifdef OF_HAVE_SANDBOX
OFSandbox *sandbox = [OFSandbox sandbox];
sandbox.allowsStdIO = true;
|
|
|
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
{ 'q', @"quiet", 0, NULL, NULL },
{ 't', @"type", 1, NULL, &type },
{ 'v', @"verbose", 0, NULL, NULL },
{ 'x', @"extract", 0, NULL, NULL },
{ '\0', nil, 0, NULL, NULL }
};
OFUnichar option, mode = '\0';
OFStringEncoding encoding = OFStringEncodingAutodetect;
OFOptionsParser *optionsParser;
OFArray OF_GENERIC(OFString *) *remainingArguments, *files;
id <Archive> archive;
#ifdef OF_HAVE_SANDBOX
OFSandbox *sandbox = [OFSandbox sandbox];
sandbox.allowsStdIO = true;
|
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
|
[OFApplication terminateWithStatus: 1];
break;
}
}
@try {
if (encodingString != nil)
encoding = of_string_parse_encoding(encodingString);
} @catch (OFInvalidArgumentException *e) {
[of_stderr writeLine: OF_LOCALIZED(
@"invalid_encoding",
@"%[prog]: Invalid encoding: %[encoding]",
@"prog", [OFApplication programName],
@"encoding", encodingString)];
|
|
|
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
|
[OFApplication terminateWithStatus: 1];
break;
}
}
@try {
if (encodingString != nil)
encoding = OFParseStringEncodingName(encodingString);
} @catch (OFInvalidArgumentException *e) {
[of_stderr writeLine: OF_LOCALIZED(
@"invalid_encoding",
@"%[prog]: Invalid encoding: %[encoding]",
@"prog", [OFApplication programName],
@"encoding", encodingString)];
|
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
|
[OFApplication terminateWithStatus: _exitStatus];
}
- (id <Archive>)openArchiveWithPath: (OFString *)path
type: (OFString *)type
mode: (char)mode
encoding: (of_string_encoding_t)encoding
{
OFString *modeString, *fileModeString;
OFStream *file = nil;
id <Archive> archive = nil;
[_archivePath release];
_archivePath = [path copy];
|
|
|
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
|
[OFApplication terminateWithStatus: _exitStatus];
}
- (id <Archive>)openArchiveWithPath: (OFString *)path
type: (OFString *)type
mode: (char)mode
encoding: (OFStringEncoding)encoding
{
OFString *modeString, *fileModeString;
OFStream *file = nil;
id <Archive> archive = nil;
[_archivePath release];
_archivePath = [path copy];
|