38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# define S_IRGRP 0
#endif
#ifndef S_IROTH
# define S_IROTH 0
#endif
#define DEFAULT_MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
OFFile *of_stdin = nil;
OFFile *of_stdout = nil;
OFFile *of_stderr = nil;
static int parse_mode(const char *mode)
{
|
>
|
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# define S_IRGRP 0
#endif
#ifndef S_IROTH
# define S_IROTH 0
#endif
#define DEFAULT_MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
#define DIR_MODE DEFAULT_MODE | S_IXUSR | S_IXGRP | S_IXOTH
OFFile *of_stdin = nil;
OFFile *of_stdout = nil;
OFFile *of_stderr = nil;
static int parse_mode(const char *mode)
{
|
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
return NO;
if (S_ISDIR(s.st_mode))
return YES;
return NO;
}
+ (OFArray*)filesInDirectoryAtPath: (OFString*)path
{
OFAutoreleasePool *pool;
OFMutableArray *files;
DIR *dir;
struct dirent *dirent;
|
>
>
>
>
>
>
>
|
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
return NO;
if (S_ISDIR(s.st_mode))
return YES;
return NO;
}
+ (void)createDirectoryAtPath: (OFString*)path
{
if (mkdir([path cString], DIR_MODE))
@throw [OFCreateDirectoryFailedException newWithClass: self
path: path];
}
+ (OFArray*)filesInDirectoryAtPath: (OFString*)path
{
OFAutoreleasePool *pool;
OFMutableArray *files;
DIR *dir;
struct dirent *dirent;
|