fs モジュールのストリーム オブジェクトを使用しようとしています。しかし、うまくいかないようです。以下は、問題を再現するための私のコーヒースクリプトです。誰かがスクリプトをチェックして、これがバグなのか、それとも間違っているのか教えてください。前もって感謝します。この質問も PhantomJs グループに投稿しましたが、回答がありません。
fs = require 'fs'
data = 'test fs'
fs.write 'tex.txt',data,'w'
rfile = fs.open('rfile.txt','w')
rfile.writeLine('testLine')
rfile.flush
rfile.close
phantom.exit()