-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <zichangguo@google.com> > Reviewed-by: Zach Anderson <zra@google.com> Bug: #42119 Change-Id: I58c3aa432d3f64bddb1deace4c9a1ceb2f0f5e16 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151035 Commit-Queue: Zichang Guo <zichangguo@google.com> Reviewed-by: Zach Anderson <zra@google.com>
- Loading branch information
Showing
3 changed files
with
182 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters