| ... | @@ -41,6 +41,15 @@ pub const File = struct { | ... | @@ -41,6 +41,15 @@ pub const File = struct { |
| 41 | read: bool = true, | 41 | read: bool = true, |
| 42 | write: bool = false, | 42 | write: bool = false, |
| 43 | | 43 | |
| | 44 | /// Open the file with exclusive access. If `write` is true, then the file is opened with an |
| | 45 | /// exclusive lock, meaning that no other processes can read or write to the file. Otherwise |
| | 46 | /// the file is opened with a shared lock, allowing the other processes to read from the |
| | 47 | /// file, but not to write to the file. |
| | 48 | /// |
| | 49 | /// Note that the lock is only advisory on Linux. This means that a process that does not |
| | 50 | /// respect the locking API can still read and write to the file, despite the lock. |
| | 51 | lock: bool = false, |
| | 52 | |
| 44 | /// This prevents `O_NONBLOCK` from being passed even if `std.io.is_async`. | 53 | /// This prevents `O_NONBLOCK` from being passed even if `std.io.is_async`. |
| 45 | /// It allows the use of `noasync` when calling functions related to opening | 54 | /// It allows the use of `noasync` when calling functions related to opening |
| 46 | /// the file, reading, and writing. | 55 | /// the file, reading, and writing. |