fix •file.CreateDir

This commit is contained in:
dzaima 2022-05-10 14:19:15 +03:00
parent 63bd4a876e
commit ec273f2102
3 changed files with 3 additions and 3 deletions

View File

@ -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");
}

View File

@ -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;
}

View File

@ -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