diff --git a/package.json b/package.json index ec892c5..6e84372 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "url": "https://github.com/cthackers/adm-zip.git" }, "engines": { - "node": ">=0.3.0" + "node": ">=6.0" }, "devDependencies": { "chai": "^4.1.2", diff --git a/util/fattr.js b/util/fattr.js index b56fbd7..be47676 100644 --- a/util/fattr.js +++ b/util/fattr.js @@ -26,8 +26,8 @@ module.exports = function(/*String*/path) { _obj.directory = _stat.isDirectory(); _obj.mtime = _stat.mtime; _obj.atime = _stat.atime; - _obj.executable = !!(1 & parseInt ((_stat.mode & parseInt ("777", 8)).toString (8)[0])); - _obj.readonly = !!(2 & parseInt ((_stat.mode & parseInt ("777", 8)).toString (8)[0])); + _obj.executable = (0o111 & _stat.mode) != 0; // file is executable who ever har right not just owner + _obj.readonly = (0o200 & _stat.mode) == 0; // readonly if owner has no write right _obj.hidden = pth.basename(_path)[0] === "."; } else { console.warn("Invalid path: " + _path)