Skip to content

Commit bc65182

Browse files
committed
fs: support as and as+ flags in stringToFlags()
1 parent 5156342 commit bc65182

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/internal/fs.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,14 @@ function stringToFlags(flags) {
223223
case 'a' : return O_APPEND | O_CREAT | O_WRONLY;
224224
case 'ax' : // Fall through.
225225
case 'xa' : return O_APPEND | O_CREAT | O_WRONLY | O_EXCL;
226+
case 'as' : // Fall through.
227+
case 'sa' : return O_APPEND | O_CREAT | O_WRONLY | O_SYNC;
226228

227229
case 'a+' : return O_APPEND | O_CREAT | O_RDWR;
228230
case 'ax+': // Fall through.
229231
case 'xa+': return O_APPEND | O_CREAT | O_RDWR | O_EXCL;
232+
case 'as+': // Fall through.
233+
case 'sa+': return O_APPEND | O_CREAT | O_RDWR | O_SYNC;
230234
}
231235

232236
throw new errors.TypeError('ERR_INVALID_OPT_VALUE', 'flags', flags);

0 commit comments

Comments
 (0)