louischatriot / nedb

The JavaScript Database, for Node.js, nw.js, electron and the browser
MIT License
13.48k stars 1.02k forks source link

Disable directory fsync on AIX #656

Open ThePrez opened 3 years ago

ThePrez commented 3 years ago

Pretty self-explanatory change. Running this on IBM i (an AIX variant), I get:

Error: Failed to flush to storage
    at /QOpenSys/pkgs/lib/nodejs12/lib/node_modules/crontab-ui/node_modules/nedb/lib/storage.js:63:19
    at FSReqCallback.oncomplete (fs.js:154:23) {
  errorOnFsync: [Error: EINVAL: invalid argument, fsync] {
    errno: -22,
    code: 'EINVAL',
    syscall: 'fsync'
  },
  errorOnClose: null
}

AIX needs the special case with Windows.