diff options
| author | LeRoyce Pearson <leroycepearson@geemili.xyz> | 2020-03-10 18:54:05 -0600 |
|---|---|---|
| committer | LeRoyce Pearson <leroycepearson@geemili.xyz> | 2020-03-14 10:12:46 -0600 |
| commit | a636b59cb58caf86dacd9814116bb459075b4cae (patch) | |
| tree | d8b0e9b88acda7ee50e76ac201d943819af514fd /lib/std/fs | |
| parent | 4eff48b12ea90ddeb86f8f089f258ae2d615c7c4 (diff) | |
| download | zig-a636b59cb58caf86dacd9814116bb459075b4cae.tar.gz zig-a636b59cb58caf86dacd9814116bb459075b4cae.zip | |
Add `lock` option to CreateFlags
Diffstat (limited to 'lib/std/fs')
| -rw-r--r-- | lib/std/fs/file.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/std/fs/file.zig b/lib/std/fs/file.zig index e892fc3b8f..ee12432496 100644 --- a/lib/std/fs/file.zig +++ b/lib/std/fs/file.zig @@ -69,6 +69,12 @@ pub const File = struct { /// `error.FileAlreadyExists` to be returned. exclusive: bool = false, + /// Prevent other files from accessing this file while this process has it is open. + /// + /// Note that the lock is only advisory on Linux. This means that a process that does not + /// respect the locking API can still read and write to the file, despite the lock. + lock: bool = false, + /// For POSIX systems this is the file system mode the file will /// be created with. mode: Mode = default_mode, |
