File tree 1 file changed +3
-0
lines changed 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,16 @@ const O_CREAT = fs.constants.O_CREAT || 0;
10
10
const O_EXCL = fs . constants . O_EXCL || 0 ;
11
11
const O_RDONLY = fs . constants . O_RDONLY || 0 ;
12
12
const O_RDWR = fs . constants . O_RDWR || 0 ;
13
+ const O_SYNC = fs . constants . O_SYNC || 0 ;
13
14
const O_TRUNC = fs . constants . O_TRUNC || 0 ;
14
15
const O_WRONLY = fs . constants . O_WRONLY || 0 ;
15
16
16
17
const { stringToFlags } = require ( 'internal/fs' ) ;
17
18
18
19
assert . strictEqual ( stringToFlags ( 'r' ) , O_RDONLY ) ;
19
20
assert . strictEqual ( stringToFlags ( 'r+' ) , O_RDWR ) ;
21
+ assert . strictEqual ( stringToFlags ( 'rs+' ) , O_RDWR | O_SYNC ) ;
22
+ assert . strictEqual ( stringToFlags ( 'sr+' ) , O_RDWR | O_SYNC ) ;
20
23
assert . strictEqual ( stringToFlags ( 'w' ) , O_TRUNC | O_CREAT | O_WRONLY ) ;
21
24
assert . strictEqual ( stringToFlags ( 'w+' ) , O_TRUNC | O_CREAT | O_RDWR ) ;
22
25
assert . strictEqual ( stringToFlags ( 'a' ) , O_APPEND | O_CREAT | O_WRONLY ) ;
You can’t perform that action at this time.
0 commit comments