You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reland "File::Copy avoids direct copying on Windows"
This is a reland of 391d3bc
The root cause of the failure is that the destination path uses forward
slashes as path separator.
This fix checks for forward slashes as a potential path separators.
If both forward and back slashes exist, the one closer to the end of the
path will be used to get the destination directory.
If any step fails, it will fall back to original copy.
Original change's description:
> File::Copy avoids direct copying on Windows
>
> There is a race condition for copying file on Windows, where CopyFile()
> returns success but data has not been populated into destination file.
> E.g process is killed or died in the middle.
>
> This cl will change File::Copy as
> 1. Copy file to a temp file in the same directory of destination file.
> 2. Rename the file to the target file.
>
> Bug: #42119
> Change-Id: I39b6d451f6ace970bc554501148259d33de232c7
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149667
> Commit-Queue: Zichang Guo <[email protected]>
> Reviewed-by: Zach Anderson <[email protected]>
Bug: #42119
Change-Id: I58c3aa432d3f64bddb1deace4c9a1ceb2f0f5e16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151035
Commit-Queue: Zichang Guo <[email protected]>
Reviewed-by: Zach Anderson <[email protected]>
0 commit comments