Skip to content

Commit

Permalink
handle the first digit in toOctal()
Browse files Browse the repository at this point in the history
To represent the setuid, setgid and sticky bits.

See: http://git.io/7EnINg
  • Loading branch information
TooTallNate committed Apr 2, 2014
1 parent 1d5e569 commit a142135
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ Mode.prototype.toString = function () {
*/

Mode.prototype.toOctal = function () {
return '0' + (this.stat.mode & 0777).toString(8);
var octal = this.stat.mode & 4095 /* 07777 */;
return ('0000' + octal.toString(8)).slice(-4);
};

Mode.prototype._checkModeProperty = function (property, set) {
Expand Down

0 comments on commit a142135

Please sign in to comment.