The size of a file being written is not updated

15 views
Skip to first unread message

Jerry Chin

unread,
Jan 19, 2017, 10:08:57 PM1/19/17
to nodejs
Hey, fellows

I'm writing a simple hybrid application with NW.js, it allows users to download great photos, a progress bar will appear while downloading, its reading is controlled by:
   
   
var filePath = "/tmp/foo.log" // another process is now writing to it.
   
var stats = fs.statSync(filePath);
  var fileSizeInBytes = stats["size"];

fileSizeInBytes in the above snippet but it's stale unless I press F5 button, is there any workarounds or solutions?

Thanks in advance.
Reply all
Reply to author
Forward
0 new messages