Skip to content

Commit

Permalink
Fix #159, correct 0o666 chmod
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Sep 11, 2017
1 parent d84fe2c commit 38b907f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rimraf.js
Expand Up @@ -5,6 +5,7 @@ var assert = require("assert")
var path = require("path")
var fs = require("fs")
var glob = require("glob")
var _0666 = parseInt('666', 8)

var defaultGlobOpts = {
nosort: true,
Expand Down Expand Up @@ -165,7 +166,7 @@ function fixWinEPERM (p, options, er, cb) {
if (er)
assert(er instanceof Error)

options.chmod(p, 666, function (er2) {
options.chmod(p, _0666, function (er2) {
if (er2)
cb(er2.code === "ENOENT" ? null : er)
else
Expand All @@ -187,7 +188,7 @@ function fixWinEPERMSync (p, options, er) {
assert(er instanceof Error)

try {
options.chmodSync(p, 666)
options.chmodSync(p, _0666)
} catch (er2) {
if (er2.code === "ENOENT")
return
Expand Down

1 comment on commit 38b907f

@mgiorgino
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also use 0o666 ;-)

Please sign in to comment.