fix •file.CreateDir
This commit is contained in:
parent
63bd4a876e
commit
ec273f2102
@ -680,7 +680,8 @@ B list_c1(B d, B x) {
|
|||||||
return path_list(path_rel(nfn_objU(d), x));
|
return path_list(path_rel(nfn_objU(d), x));
|
||||||
}
|
}
|
||||||
B createdir_c1(B d, B x) {
|
B createdir_c1(B d, B x) {
|
||||||
if (dir_create(path_rel(nfn_objU(d), x))) return m_i32(1);
|
B p = path_rel(nfn_objU(d), x);
|
||||||
|
if (dir_create(p)) return p;
|
||||||
thrM("(file).CreateDir: Failed to create directory");
|
thrM("(file).CreateDir: Failed to create directory");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -309,7 +309,6 @@ bool dir_create(B path) {
|
|||||||
char* p = toCStr(path);
|
char* p = toCStr(path);
|
||||||
bool r = mkdir(p, S_IRWXU) == 0;
|
bool r = mkdir(p, S_IRWXU) == 0;
|
||||||
freeCStr(p);
|
freeCStr(p);
|
||||||
dec(path);
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ B path_lines(B path); // consumes
|
|||||||
I8Arr* stream_bytes(FILE* f);
|
I8Arr* stream_bytes(FILE* f);
|
||||||
|
|
||||||
B mmap_file(B path); // consumes
|
B mmap_file(B path); // consumes
|
||||||
bool dir_create(B path); // consumes
|
bool dir_create(B path); // doesn't consume
|
||||||
|
|
||||||
void path_wChars(B path, B x); // consumes path
|
void path_wChars(B path, B x); // consumes path
|
||||||
void path_wBytes(B path, B x); // consumes path
|
void path_wBytes(B path, B x); // consumes path
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user