Skip to content

Commit

Permalink
Add EBUSY to handled error codes for windows directory rename
Browse files Browse the repository at this point in the history
Fix: #127
  • Loading branch information
isaacs committed Mar 16, 2023
1 parent f6ad4ec commit ab32dab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion polyfills.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function patch (fs) {
var backoff = 0;
fs$rename(from, to, function CB (er) {
if (er
&& (er.code === "EACCES" || er.code === "EPERM")
&& (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY")
&& Date.now() - start < 60000) {
setTimeout(function() {
fs.stat(to, function (stater, st) {
Expand Down
2 changes: 1 addition & 1 deletion test/windows-rename-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var t = require('tap')

var fs = require('fs')

var ers = ['EPERM', 'EACCES']
var ers = ['EPERM', 'EBUSY', 'EACCES']
t.plan(ers.length)
ers.forEach(function(code) {
t.test(code, function(t) {
Expand Down

0 comments on commit ab32dab

Please sign in to comment.