From dde4f518b033dfb05c5068a984a885ed9c2e313b Mon Sep 17 00:00:00 2001 From: 5saviahv Date: Thu, 19 Nov 2020 15:28:06 +0200 Subject: [PATCH] Node v6 --- package.json | 2 +- util/fattr.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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)