Skip to content

Instantly share code, notes, and snippets.

@mdz
Created February 9, 2012 00:34
Show Gist options
  • Select an option

  • Save mdz/1775897 to your computer and use it in GitHub Desktop.

Select an option

Save mdz/1775897 to your computer and use it in GitHub Desktop.
fs.chown = chownFix(fs.chown)
fs.fchown = chownFix(fs.fchown)
fs.lchown = chownFix(fs.lchown)
fs.chownSync = chownFixSync(fs.chownSync)
fs.fchownSync = chownFixSync(fs.fchownSync)
fs.lchownSync = chownFixSync(fs.lchownSync)
function chownFix (orig) {
return function (target, uid, gid, cb) {
return orig.call(fs, target, uid, gid, function (er, res) {
if (chownErOk(er)) er = null
cb(er, res)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment