From 56ceacae1aa0159aee999745712ee75850dd45f2 Mon Sep 17 00:00:00 2001 From: areve Date: Fri, 29 Nov 2013 12:46:50 +0000 Subject: [PATCH] Update polyfills.js changed renameSync like rename --- polyfills.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/polyfills.js b/polyfills.js index afc83b3..84c1fb6 100644 --- a/polyfills.js +++ b/polyfills.js @@ -190,6 +190,19 @@ if (process.platform === "win32") { cb(er) }) } + + var renameSync_ = fs.renameSync + fs.renameSync = function renameSync (from, to) { + var start = Date.now() + while (true) { + try { + return renameSync_(from, to); + } catch(er) { + if (er.code !== "EACCES" && er.code !== "EPERM") throw er; + if (Date.now() - start > 1000) throw er; + } + } + } }