graceful-fs
Advanced tools
Comparing version 4.1.6 to 4.1.7
{ | ||
"name": "graceful-fs", | ||
"description": "A drop-in replacement for fs, making various improvements.", | ||
"version": "4.1.6", | ||
"version": "4.1.7", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
@@ -59,2 +59,10 @@ var fs = require('./fs.js') | ||
fs.stat = statFix(fs.stat) | ||
fs.fstat = statFix(fs.fstat) | ||
fs.lstat = statFix(fs.lstat) | ||
fs.statSync = statFixSync(fs.statSync) | ||
fs.fstatSync = statFixSync(fs.fstatSync) | ||
fs.lstatSync = statFixSync(fs.lstatSync) | ||
// if lchmod/lchown do not exist, then make them no-ops | ||
@@ -250,2 +258,28 @@ if (!fs.lchmod) { | ||
function statFix (orig) { | ||
if (!orig) return orig | ||
// Older versions of Node erroneously returned signed integers for | ||
// uid + gid. | ||
return function (target, cb) { | ||
return orig.call(fs, target, function (er, stats) { | ||
if (stats.uid < 0) stats.uid += 0x100000000 | ||
if (stats.gid < 0) stats.gid += 0x100000000 | ||
if (cb) cb.apply(this, arguments) | ||
}) | ||
} | ||
} | ||
function statFixSync (orig) { | ||
if (!orig) return orig | ||
// Older versions of Node erroneously returned signed integers for | ||
// uid + gid. | ||
return function (target) { | ||
var stats = orig.call(fs, target) | ||
if (stats.uid < 0) stats.uid += 0x100000000 | ||
if (stats.gid < 0) stats.gid += 0x100000000 | ||
return stats; | ||
} | ||
} | ||
// ENOSYS means that the fs doesn't support the op. Just ignore | ||
@@ -252,0 +286,0 @@ // that, because it doesn't matter. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23976
596