about summary refs log tree commit diff
path: root/library/std/src/sys/fs/windows.rs
AgeCommit message (Collapse)AuthorLines
2025-09-04Rollup merge of #140459 - niklasf:feature/read-buf-at, r=tgross35Stuart Cook-0/+4
Add `read_buf` equivalents for positioned reads Adds the following items under the ~~`read_buf` (rust-lang/rust#78485)~~ `read_buf_at` (rust-lang/rust#140771) feature: - `std::os::unix::fs::FileExt::read_buf_at` - `std::os::unix::fs::FileExt::read_buf_exact_at` - `std::os::windows::fs::FileExt::seek_read_buf` try-job: `x86_64-msvc*` try-job: `test-various*` try-job: `dist-various*`
2025-09-03Add `read_buf` equivalents for positioned readsNiklas Fiekas-0/+4
Adds the following items under the `read_buf_at` feature: - `std::os::unix::fs::FileExt::read_buf_at` - `std::os::unix::fs::FileExt::read_buf_exact_at` - `std::os::windows::fs::FileExt::seek_read_buf`
2025-08-30std: clarify `OpenOptions` error for create without write accessVladimir Petrzhikovskii-3/+21
Previously, attempting to create/truncate a file without write/append access would result in platform-specific error messages: - Unix: "Invalid argument" - Windows: raw OS error code 87 These error codes look like system errors, which could waste hours of debugging for what is actually an API misuse issue.
2025-08-12Add cast_init and cast_uninit methods for pointersltdk-1/+1
2025-08-09Replace unsafe function with safe alternativeChris Denton-5/+10
The `security_attributes` function is marked as safe despite taking a raw pointer which will later be used. Fortunately this function is only used internally and only in one place that has been basically the same for a decade now. However, we only ever set one bool so it's easy enough to replace with something that's actually safe.
2025-06-13Windows: make read_dir stop iterating on errorChris Denton-0/+1
2025-06-05Optimize `Seek::stream_len` impl for `File`Tobias Bucher-0/+8
It uses the file metadata on Unix with a fallback for files incorrectly reported as zero-sized. It uses `GetFileSizeEx` on Windows. This reduces the number of syscalls needed for determining the file size of an open file from 3 to 1.
2025-05-20Remove unnecessary handling of ERROR_IO_PENDINGChristopher Berner-8/+2
try_lock() and try_lock_shared() do not need to handle these per the discussion in https://github.com/rust-lang/rust/pull/140718#discussion_r2076678485
2025-05-03Rollup merge of #139343 - cberner:filelock_wouldblock, r=workingjubileeMatthias Krüger-8/+9
Change signature of File::try_lock and File::try_lock_shared These methods now return Result<(), TryLockError> instead of Result<bool, Error> to make their use less errorprone These methods are unstable under the "file_lock" feature. The related tracking issue is https://github.com/rust-lang/rust/pull/130999 and this PR changes the signatures as discussed by libs-api: https://github.com/rust-lang/rust/issues/130994#issuecomment-2770838848
2025-05-01Change signature of File::try_lock and File::try_lock_sharedChristopher Berner-8/+9
These methods now return Result<(), TryLockError> instead of Result<bool, Error> to make their use less errorprone
2025-04-11Use with_native_path for WindowsChris Denton-39/+30
Also add a WCStr type
2025-03-25Fix UWP reparse point checkChris Denton-1/+1
2025-03-18Windows: fix FileType PartialEq implementationChris Denton-18/+15
2025-03-08Move fs into sysThalia Archibald-0/+1662