1
2
3
4
5
6
7
8
9
|
/*
* Copyright (c) 2008-2022 Jonathan Schleifer <js@nil.im>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
|
|
1
2
3
4
5
6
7
8
9
|
/*
* Copyright (c) 2008-2023 Jonathan Schleifer <js@nil.im>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#include <string.h>
#import "OFApplication.h"
#import "OFArray.h"
#import "OFFile.h"
#import "OFFileManager.h"
#import "OFLocale.h"
#import "OFOptionsParser.h"
#import "OFSandbox.h"
#import "OFStdIOStream.h"
#import "OFURI.h"
#import "OFArc.h"
#import "GZIPArchive.h"
#import "LHAArchive.h"
#import "TarArchive.h"
#import "ZIPArchive.h"
|
>
<
|
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#include <string.h>
#import "OFApplication.h"
#import "OFArray.h"
#import "OFFile.h"
#import "OFFileManager.h"
#import "OFIRI.h"
#import "OFLocale.h"
#import "OFOptionsParser.h"
#import "OFSandbox.h"
#import "OFStdIOStream.h"
#import "OFArc.h"
#import "GZIPArchive.h"
#import "LHAArchive.h"
#import "TarArchive.h"
#import "ZIPArchive.h"
|
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
|
/* Dropped after parsing options */
sandbox.allowsUnveil = true;
[OFApplication of_activateSandbox: sandbox];
#endif
#ifndef OF_AMIGAOS
[OFLocale addLocalizationDirectory: @LOCALIZATION_DIR];
#else
[OFLocale addLocalizationDirectory:
@"PROGDIR:/share/ofarc/localization"];
#endif
optionsParser = [OFOptionsParser parserWithOptions: options];
while ((option = [optionsParser nextOption]) != '\0') {
switch (option) {
case 'f':
if (_overwrite < 0)
|
|
>
|
|
|
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
/* Dropped after parsing options */
sandbox.allowsUnveil = true;
[OFApplication of_activateSandbox: sandbox];
#endif
#ifndef OF_AMIGAOS
[OFLocale addLocalizationDirectoryIRI:
[OFIRI fileIRIWithPath: @LOCALIZATION_DIR]];
#else
[OFLocale addLocalizationDirectoryIRI:
[OFIRI fileIRIWithPath: @"PROGDIR:/share/ofarc/localization"]];
#endif
optionsParser = [OFOptionsParser parserWithOptions: options];
while ((option = [optionsParser nextOption]) != '\0') {
switch (option) {
case 'f':
if (_overwrite < 0)
|
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
|
OFString *error = [OFString
stringWithCString: strerror(e.errNo)
encoding: [OFLocale encoding]];
[OFStdErr writeString: @"\r"];
[OFStdErr writeLine: OF_LOCALIZED(
@"failed_to_create_directory",
@"Failed to create directory %[dir]: %[error]",
@"dir", e.URI.fileSystemRepresentation,
@"error", error)];
_exitStatus = 1;
} @catch (OFOpenItemFailedException *e) {
OFString *error = [OFString
stringWithCString: strerror(e.errNo)
encoding: [OFLocale encoding]];
[OFStdErr writeString: @"\r"];
|
|
|
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
|
OFString *error = [OFString
stringWithCString: strerror(e.errNo)
encoding: [OFLocale encoding]];
[OFStdErr writeString: @"\r"];
[OFStdErr writeLine: OF_LOCALIZED(
@"failed_to_create_directory",
@"Failed to create directory %[dir]: %[error]",
@"dir", e.IRI.fileSystemRepresentation,
@"error", error)];
_exitStatus = 1;
} @catch (OFOpenItemFailedException *e) {
OFString *error = [OFString
stringWithCString: strerror(e.errNo)
encoding: [OFLocale encoding]];
[OFStdErr writeString: @"\r"];
|