mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Close persistent file before attempting to rename.
Windows requires the file be closed in order to rename it.
This commit is contained in:
@@ -803,6 +803,7 @@ const char* Storage::SavePersistent(StringRef filename, bool periodic) const {
|
||||
err = "error saving file";
|
||||
goto done;
|
||||
}
|
||||
os.close();
|
||||
|
||||
// Safely move to real file. We ignore any failures related to the backup.
|
||||
std::remove(bak.c_str());
|
||||
|
||||
Reference in New Issue
Block a user