[fs] Enable mode for mkdir on unix (#746)

This commit is contained in:
Kevin (Kun) "Kassimo" Qian 2018-09-14 12:30:43 -07:00 committed by Ryan Dahl
parent 66c09de967
commit 662e57b20a
5 changed files with 36 additions and 15 deletions

View file

@ -9,6 +9,15 @@ testPerm({ write: true }, function mkdirSyncSuccess() {
assert(pathInfo.isDirectory());
});
testPerm({ write: true }, function mkdirSyncMode() {
const path = deno.makeTempDirSync() + "/dir/subdir";
deno.mkdirSync(path, 0o755); // no perm for x
const pathInfo = deno.statSync(path);
if (pathInfo.mode !== null) { // Skip windows
assertEqual(pathInfo.mode & 0o777, 0o755);
}
});
testPerm({ write: false }, function mkdirSyncPerm() {
let err;
try {