Skip to content

windows seek_write: document interaction with append mode - #166155

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:windows-seek-write-append
Nov 19, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:windows-seek-write-append

Conversation

@RalfJung

@RalfJung RalfJung commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

MS docs say that the offset is ignored for files opened with FILE_APPEND_DATA. Our append(true) maps to c::FILE_GENERIC_WRITE & !c::FILE_WRITE_DATA for CreateFileW... which then presumably translates into FILE_APPEND_DATA for NtCreateFile?

r? @ChrisDenton

@rustbot rustbot added O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 18, 2026
@ChrisDenton

Copy link
Copy Markdown
Member

Our append(true) maps to c::FILE_GENERIC_WRITE & !c::FILE_WRITE_DATA for CreateFileW... which then presumably translates into FILE_APPEND_DATA for NtCreateFile?

More or less. FILE_GENERIC_WRITE also grants a few other rights, like the ability to write file attributes. But they aren't relevant here.

@bors r+

@rust-bors

rust-bors Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 438f8b6 has been tentatively approved by ChrisDenton

It will be put into the queue for this repository once PR CI succeeds.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 18, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 18, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #165913 (MirPatch: reduce new statement insertion complexity)
 - #166081 (test `feature(asm_const_ptr)` with a vtable)
 - #166094 (Chain the spans of qualified paths instead of having a first-to-last scheme )
 - #166113 (Fix dead-code marking dead enum variants as live)
 - #166118 (rustc_target: catch up with LLVM 24 movement on ppc64le bsd data layout)
 - #166155 (windows seek_write: document interaction with append mode)
 - #165935 (Duplicate attribute diagnostic cleanups)
 - #165948 (lint: Avoid unused_parens warning for ref patterns binding an identifier)
 - #166018 (`rustc_mir_build`: de-duplicate `local_temp_lifetime()`)
 - #166111 (Add `cd` alias to `std::env::set_current_dir`)
 - #166157 (Don't recover invalid literals in attribute parsing)
rust-bors Bot pushed a commit that referenced this pull request Nov 19, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #165913 (MirPatch: reduce new statement insertion complexity)
 - #166081 (test `feature(asm_const_ptr)` with a vtable)
 - #166094 (Chain the spans of qualified paths instead of having a first-to-last scheme )
 - #166113 (Fix dead-code marking dead enum variants as live)
 - #166118 (rustc_target: catch up with LLVM 24 movement on ppc64le bsd data layout)
 - #166155 (windows seek_write: document interaction with append mode)
 - #165935 (Duplicate attribute diagnostic cleanups)
 - #165948 (lint: Avoid unused_parens warning for ref patterns binding an identifier)
 - #166018 (`rustc_mir_build`: de-duplicate `local_temp_lifetime()`)
 - #166111 (Add `cd` alias to `std::env::set_current_dir`)
 - #166157 (Don't recover invalid literals in attribute parsing)
@rust-bors
rust-bors Bot merged commit a297341 into rust-lang:main Nov 19, 2026
14 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 19, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 19, 2026
Rollup merge of #166155 - RalfJung:windows-seek-write-append, r=ChrisDenton

windows seek_write: document interaction with append mode

[MS docs](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-ntwritefile) say that the offset is ignored for files opened with FILE_APPEND_DATA. Our `append(true)` [maps to](https://github.com/rust-lang/rust/blob/0df97849e3a1abbaff8969ec3b9cd9334ab68790/library/std/src/sys/fs/windows.rs#L294-L295) `c::FILE_GENERIC_WRITE & !c::FILE_WRITE_DATA` for `CreateFileW`... which then presumably translates into `FILE_APPEND_DATA` for `NtCreateFile`?

r? @ChrisDenton
@RalfJung
RalfJung deleted the windows-seek-write-append branch November 19, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-windows Operating system: Windows S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants