1
Fork 0

Document that locking a file fails on Windows if the file is opened only for append

This commit is contained in:
Josh Triplett 2025-02-11 17:51:30 +01:00
parent 16abb39c9d
commit bc59397f8f

View file

@ -648,6 +648,9 @@ impl File {
/// and the `LockFileEx` function on Windows with the `LOCKFILE_EXCLUSIVE_LOCK` flag. Note that,
/// this [may change in the future][changes].
///
/// On Windows, locking a file will fail if the file is opened only for append. To lock a file,
/// open it with either `.read(true).append(true)` or `.write(true)`.
///
/// [changes]: io#platform-specific-behavior
///
/// [`lock`]: File::lock
@ -698,6 +701,9 @@ impl File {
/// and the `LockFileEx` function on Windows. Note that, this
/// [may change in the future][changes].
///
/// On Windows, locking a file will fail if the file is opened only for append. To lock a file,
/// open it with either `.read(true).append(true)` or `.write(true)`.
///
/// [changes]: io#platform-specific-behavior
///
/// [`lock`]: File::lock
@ -753,6 +759,9 @@ impl File {
/// and `LOCKFILE_FAIL_IMMEDIATELY` flags. Note that, this
/// [may change in the future][changes].
///
/// On Windows, locking a file will fail if the file is opened only for append. To lock a file,
/// open it with either `.read(true).append(true)` or `.write(true)`.
///
/// [changes]: io#platform-specific-behavior
///
/// [`lock`]: File::lock
@ -807,6 +816,9 @@ impl File {
/// `LOCKFILE_FAIL_IMMEDIATELY` flag. Note that, this
/// [may change in the future][changes].
///
/// On Windows, locking a file will fail if the file is opened only for append. To lock a file,
/// open it with either `.read(true).append(true)` or `.write(true)`.
///
/// [changes]: io#platform-specific-behavior
///
/// [`lock`]: File::lock
@ -849,6 +861,9 @@ impl File {
/// and the `UnlockFile` function on Windows. Note that, this
/// [may change in the future][changes].
///
/// On Windows, locking a file will fail if the file is opened only for append. To lock a file,
/// open it with either `.read(true).append(true)` or `.write(true)`.
///
/// [changes]: io#platform-specific-behavior
///
/// # Examples