Hopefully-temp fix for windos

pull/2/head
Louis Chatriot 9 years ago
parent 757f4a8322
commit cf4f1f58d4
  1. 4
      lib/storage.js

@ -38,6 +38,10 @@ storage.ensureFileDoesntExist = function (file, callback) {
* Flush data in OS buffer to storage if corresponding option is set
*/
storage.flushToStorage = function (filename, callback) {
// Hate having to do this but I can't seem to make fs.fsync work on Windows, and still don't even know whether fsync can be used on Windows.
// See this issue: https://github.com/nodejs/node/issues/3879
if (process.platform === 'win32' || process.platform === 'win64') { return callback(); }
fs.open(filename, 'r', function (err, fd) {
if (err) { return callback(err); }
fs.fsync(fd, function (err) { return callback(err); });

Loading…
Cancel
Save