- if (Utils.isNullOrUndefined(this?.fd)) {
- this.fd = fs.openSync(this.dbName, 'a+');
+ if (isNullOrUndefined(this?.fd)) {
+ if (!existsSync(dirname(this.dbName))) {
+ mkdirSync(dirname(this.dbName), { recursive: true });
+ }
+ this.fd = openSync(this.dbName, 'a+');