Skip to content

Commit 49fef76

Browse files
committed
fix: create splay dir before saving sym table
1 parent 5161cf2 commit 49fef76

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/store/splay.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ ray_err_t ray_splay_save(ray_t* tbl, const char* dir, const char* sym_path) {
6363
if (!tbl || RAY_IS_ERR(tbl)) return RAY_ERR_TYPE;
6464
if (!dir) return RAY_ERR_IO;
6565

66+
/* Create directory (before sym save, since sym_path may be inside dir) */
67+
if (mkdir(dir, 0755) != 0 && errno != EEXIST) return RAY_ERR_IO;
68+
6669
/* Save symbol table if sym_path provided */
6770
if (sym_path) {
6871
ray_err_t sym_err = ray_sym_save(sym_path);
6972
if (sym_err != RAY_OK) return sym_err;
7073
}
7174

72-
/* Create directory */
73-
if (mkdir(dir, 0755) != 0 && errno != EEXIST) return RAY_ERR_IO;
74-
7575
int64_t ncols = ray_table_ncols(tbl);
7676

7777
/* Save .d schema file */

0 commit comments

Comments
 (0)