about summary refs log tree commit diff
path: root/library/std/src/sys/windows/fs.rs
AgeCommit message (Collapse)AuthorLines
2022-03-29Make the stdlib largely conform to strict provenance.Aria Beingessner-4/+7
Some things like the unwinders and system APIs are not fully conformant, this only covers a lot of low-hanging fruit.
2022-03-03Use `HandleOrNull` and `HandleOrInvalid` in the Windows FFI bindings.Dan Gohman-3/+4
Use the new `HandleOrNull` and `HandleOrInvalid` types that were introduced as part of [I/O safety] in a few functions in the Windows FFI bindings. This factors out an `unsafe` block and two `unsafe` function calls in the Windows implementation code. And, it helps test `HandleOrNull` and `HandleOrInvalid`, which indeed turned up a bug: `OwnedHandle` also needs to be `#[repr(transparent)]`, as it's used inside of `HandleOrNull` and `HandleOrInvalid` which are also `#[repr(transparent)]`. [I/O safety]: https://github.com/rust-lang/rust/issues/87074
2022-02-08Rollup merge of #93206 - ChrisDenton:ntopenfile, r=nagisaMatthias Krüger-3/+8
Use `NtCreateFile` instead of `NtOpenFile` to open a file Generally the internal `Nt*` functions should be avoided but when we do need to use one we should stick to the most commonly used for the job. To that end, this PR replaces `NtOpenFile` with `NtCreateFile`. NOTE: The initial version of this comment hypothesised that this may help with some recent false positives from malware scanners. This hypothesis proved wrong. Sorry for the distraction.
2022-02-04Hide Repr details from io::Error, and rework `io::Error::new_const`.Thom Chiovoloni-4/+4
2022-01-25Rollup merge of #88794 - sunfishcode:sunfishcode/try-clone, r=joshtriplettMatthias Krüger-1/+1
Add a `try_clone()` function to `OwnedFd`. As suggested in #88564. This adds a `try_clone()` to `OwnedFd` by refactoring the code out of the existing `File`/`Socket` code. r? ``@joshtriplett``
2022-01-24Use `NtCreateFile` instead of `NtOpenFile` to open a fileChris Denton-3/+8
2022-01-19Fix CVE-2022-21658 for WindowsChris Denton-17/+305
2021-11-02more efficent File::read_buf impl for windows and unixDrMeepster-1/+5
2021-10-30Auto merge of #89174 - ChrisDenton:automatic-verbatim-paths, r=dtolnaybors-13/+14
Automatically convert paths to verbatim for filesystem operations that support it This allows using longer paths without the user needing to `canonicalize` or manually prefix paths. If the path is already verbatim then this has no effect. Fixes: #32689
2021-10-09Apply clippy suggestionsClemens Wasser-2/+2
2021-10-03Automatically convert paths to verbatimChris Denton-13/+14
This allows using longer paths for filesystem operations without the user needing to `canonicalize` or manually prefix paths. If the path is already verbatim than this has no effect.
2021-09-09Fix Windows compilation errors.Dan Gohman-1/+1
2021-09-09Add a `try_clone()` function to `OwnedFd`.Dan Gohman-1/+1
As suggested in #88564. This adds a `try_clone()` to `OwnedFd` by refactoring the code out of the existing `File`/`Socket` code.
2021-09-02I/O safety for WinUWPbdbai-2/+2
2021-08-19I/O safety.Dan Gohman-22/+51
Introduce `OwnedFd` and `BorrowedFd`, and the `AsFd` trait, and implementations of `AsFd`, `From<OwnedFd>` and `From<T> for OwnedFd` for relevant types, along with Windows counterparts for handles and sockets. Tracking issue: - <https://github.com/rust-lang/rust/issues/87074> RFC: - <https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md>
2021-06-15Rename ErrorKind::Unknown to Uncategorized.Mara Bos-1/+1
2021-06-15Redefine `ErrorKind::Other` and stop using it in std.Mara Bos-4/+3
2021-05-19Windows implementation of `fs::try_exists`Chris Denton-1/+29
2021-05-19Move the implementation of `Path::exists` to `sys_common::fs` so platforms ↵Chris Denton-0/+1
can specialize it Windows implementation of `fs::try_exists`
2021-04-18Rename `NotSupported` to `Unsupported`Christiaan Dirkx-1/+4
2021-04-18Add and insta-stabilize `std::io::ErrorKind::NotSupported`Christiaan Dirkx-1/+1
2021-03-21Use io::Error::new_const everywhere to avoid allocations.Mara Bos-3/+3
2020-11-14Disambiguate symlink argument namesDavid Tolnay-17/+22
2020-07-27mv std libs to library/mark-0/+938