Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit a172d4d

Browse files
Revert "Win: Use FILE_RENAME_FLAG_POSIX_SEMANTICS for std::fs::rename if available"
This reverts commit 1e414f1.
1 parent 7bb4faa commit a172d4d

File tree

4 files changed

+2563
-168
lines changed

4 files changed

+2563
-168
lines changed

library/std/src/fs.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,14 +2446,12 @@ pub fn symlink_metadata<P: AsRef<Path>>(path: P) -> io::Result<Metadata> {
24462446
/// # Platform-specific behavior
24472447
///
24482448
/// This function currently corresponds to the `rename` function on Unix
2449-
/// and the `SetFileInformationByHandle` function on Windows.
2449+
/// and the `MoveFileEx` function with the `MOVEFILE_REPLACE_EXISTING` flag on Windows.
24502450
///
24512451
/// Because of this, the behavior when both `from` and `to` exist differs. On
24522452
/// Unix, if `from` is a directory, `to` must also be an (empty) directory. If
2453-
/// `from` is not a directory, `to` must also be not a directory. The behavior
2454-
/// on Windows is the same on Windows 10 1607 and higher if `FileRenameInfoEx`
2455-
/// is supported by the filesystem; otherwise, `from` can be anything, but
2456-
/// `to` must *not* be a directory.
2453+
/// `from` is not a directory, `to` must also be not a directory. In contrast,
2454+
/// on Windows, `from` can be anything, but `to` must *not* be a directory.
24572455
///
24582456
/// Note that, this [may change in the future][changes].
24592457
///

0 commit comments

Comments
 (0)