[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

test[nodeJS] 047 File flush (sync)

"047-10 Flushing data with #fsyncSync:"
| fs |
fs := NodeJS fs.
fs open: (TestPath, 'Sample47-10.txt') flags: #w with: [:error :fd| 
   error isNil ifFalse: [ ^self error: '047-10 ' ,error].
   [fs writeSync: fd data: 'Limelight' position: 0 ]
	on: Error
	do: [:ex| self error: '047-10 ' ,ex].
    [fs fsyncSync: fd] 
       on: Error
       do: [:ex| self error: '047-10 ' ,ex].    
    fs closeSync:fd.
].