mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 20:59:10 +00:00
Rename perm to mode (#4276)
There's a lot of variation in doc comments and internal code about whether chmod/0o777-style permissions are called `mode` or `perm`. (For example, mkdir and writeFile choose differently.) Had proposed earlier to go consistently with `perm`, but on balance devs prefer to go with `mode`.
This commit is contained in:
parent
8d1ba3552f
commit
0dd131d4a5
12 changed files with 52 additions and 51 deletions
|
@ -10,7 +10,7 @@ unitTest(
|
|||
const data = enc.encode("Hello");
|
||||
const tempDir = Deno.makeTempDirSync();
|
||||
const filename = tempDir + "/test.txt";
|
||||
Deno.writeFileSync(filename, data, { perm: 0o666 });
|
||||
Deno.writeFileSync(filename, data, { mode: 0o666 });
|
||||
|
||||
// On windows no effect, but should not crash
|
||||
Deno.chmodSync(filename, 0o777);
|
||||
|
@ -36,7 +36,7 @@ unitTest(
|
|||
const tempDir = Deno.makeTempDirSync();
|
||||
|
||||
const filename = tempDir + "/test.txt";
|
||||
Deno.writeFileSync(filename, data, { perm: 0o666 });
|
||||
Deno.writeFileSync(filename, data, { mode: 0o666 });
|
||||
const symlinkName = tempDir + "/test_symlink.txt";
|
||||
Deno.symlinkSync(filename, symlinkName);
|
||||
|
||||
|
@ -85,7 +85,7 @@ unitTest(
|
|||
const data = enc.encode("Hello");
|
||||
const tempDir = Deno.makeTempDirSync();
|
||||
const filename = tempDir + "/test.txt";
|
||||
Deno.writeFileSync(filename, data, { perm: 0o666 });
|
||||
Deno.writeFileSync(filename, data, { mode: 0o666 });
|
||||
|
||||
// On windows no effect, but should not crash
|
||||
await Deno.chmod(filename, 0o777);
|
||||
|
@ -112,7 +112,7 @@ unitTest(
|
|||
const tempDir = Deno.makeTempDirSync();
|
||||
|
||||
const filename = tempDir + "/test.txt";
|
||||
Deno.writeFileSync(filename, data, { perm: 0o666 });
|
||||
Deno.writeFileSync(filename, data, { mode: 0o666 });
|
||||
const symlinkName = tempDir + "/test_symlink.txt";
|
||||
Deno.symlinkSync(filename, symlinkName);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue