authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-02 18:56:43-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-03 01:00:44-05:00
log426c13dddfa9e19cf505fc26561d2a8637165d64
treea0201b3e7a6accad8020b2d9f6f120dc2f652b90
parent4789cc0249f8dd6b76471abda0c6eaa16d75bd69

add doc comments to std.fs.File.default_mode


1 files changed, 6 insertions(+), 0 deletions(-)

lib/std/fs/file.zig+6
......@@ -48,6 +48,12 @@ pub const File = struct {
4848 Unknown,
4949 };
5050
51 /// This is the default mode given to POSIX operating systems for creating
52 /// files. `0o666` is "-rw-rw-rw-" which is counter-intuitive at first,
53 /// since most people would expect "-rw-r--r--", for example, when using
54 /// the `touch` command, which would correspond to `0o644`. However, POSIX
55 /// libc implementations use `0o666` inside `fopen` and then rely on the
56 /// process-scoped "umask" setting to adjust this number for file creation.
5157 pub const default_mode = switch (builtin.os.tag) {
5258 .windows => 0,
5359 .wasi => 0,