-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
I have a build where several projects generate the same file in the common output directory using WriteLinesToFile.
Something changed recently and the timing is now such that two projects attempt to write to the same file simultaneously. One project can't open the file for writing because the other project has the file open.
I understand it's not desireable to have double-writes, but I thought that perhaps WriteLinesToFile needs to have a transactional mode.
The Visual Studio editor has this mode already (and it's the default one): when saving a file, first write to a new temp file, then rename the current file to old, then rename the new file to current, then delete the old file. If the rename part fails because the file is locked, you could have retries.