Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c99f7369c0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| try File.System.Move.move( | ||
| from: try swiftFileSystemPath(path), | ||
| to: try swiftFileSystemPath(to), | ||
| options: .init(overwrite: true) | ||
| ) |
There was a problem hiding this comment.
Handle replacing non-empty directories
replace(_:with:) now routes through File.System.Move.move(..., options: .init(overwrite: true)). In the vendored POSIX move path, overwrite still relies on rename and does not remove an existing destination directory first, so replacing into a non-empty directory fails with ENOTEMPTY/EEXIST instead of actually replacing it. This breaks callers that use replace to refresh directory trees and also diverges from the Windows branch, which removes the destination before copying.
Useful? React with 👍 / 👎.
| try File.System.Move.move( | ||
| from: try swiftFileSystemPath(from), | ||
| to: try swiftFileSystemPath(to) | ||
| ) |
There was a problem hiding this comment.
Support cross-device directory moves
move(from:to:options:) now always uses File.System.Move.move on non-Windows. That move implementation only falls back on EXDEV via a copy+delete path that calls File.System.Copy._copyPOSIX, which explicitly rejects directories, so directory moves across filesystems fail instead of succeeding. This can break normal workflows when source and destination are on different mounts (for example temp dirs vs workspace volumes).
Useful? React with 👍 / 👎.
Summary
FileSystemonto the new default implementation on non-Windows platforms and delete the env-based backend switch.Testing
swift test