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));
|
||||
}
|
||||
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");
|
||||
}
|
||||
|
||||
|
||||
@ -309,7 +309,6 @@ bool dir_create(B path) {
|
||||
char* p = toCStr(path);
|
||||
bool r = mkdir(p, S_IRWXU) == 0;
|
||||
freeCStr(p);
|
||||
dec(path);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ B path_lines(B path); // consumes
|
||||
I8Arr* stream_bytes(FILE* f);
|
||||
|
||||
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_wBytes(B path, B x); // consumes path
|
||||
|
||||
Loading…
Reference in New Issue
Block a user