From: bors Date: Tue, 12 Apr 2016 17:12:55 +0000 (-0700) Subject: Auto merge of #31963 - barosl:rename-doc, r=alexcrichton X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=a4f781e47710d8c938130446bf4cd5e9be2231d2;p=rust.git Auto merge of #31963 - barosl:rename-doc, r=alexcrichton Describe more platform-specific behaviors of `std::fs::rename` I did some tests myself regarding the situation when both `from` and `to` exist, and the results were: On Linux: `from` | `to` | Result ---- | ---- | ---- Directory | Directory | Ok Directory | File | Error File | Directory | Error File | File | Ok On Windows: `from` | `to` | Result ---- | ---- | ---- Directory | Directory | Error Directory | File | Ok File | Directory | Error File | File | Ok This is a bit against the official MSDN documentation, which says "(`MOVEFILE_REPLACE_EXISTING`) cannot be used if `lpNewFileName` or `lpExistingFileName` names a directory." As evidenced above, `lpExistingFileName` *can* be a directory. I also mentioned the atomicity of the operation. Fixes #31301. --- a4f781e47710d8c938130446bf4cd5e9be2231d2