[View] [Edit] [Lock] [References] [Attachments] [History] [Home] [Changes] [Search] [Help]
test[nodeJS] 047 File flush (async)
"047-11 Flushing data with #fsync:with:"
| fs |
fs := NodeJS fs.
fs open: (TestPath, 'Sample47-11.txt') flags:#w mode:0666 with: [:error :fd|
error isNil ifFalse: [self error: '047-11 ' ,error].
[fs writeSync: fd data: 'Vital Signs' position: 0 ]
on: Error
do: [:ex| ^self error: '047-11 ' ,ex].
fs fsync: fd with:[:err|
err isNil ifFalse: [ ^self error: '047-11 ' ,err].
fs closeSync:fd.
]
].