mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-24 22:38:02 -05:00
Reworked the rename_file() function on Windows to work reliably and
atomically. The code was taken from the llvm project, it is complex and hopefully it covers all the Windows file system quirks. Vojtech has highest hopes, that this will fix the various PrusaSlicer.ini file corruptions. Enabled the locales switching and error handling on Linux as well, where now the missing locales are reported and running the locale-gen tool is recommended.
This commit is contained in:
1 parent
a83da0f72c
commit
fd3fe75d1c
6 files changed
+248
-62
No files matched your search
@@ -607,7 +607,7 @@ void GCode::do_export(Print *print, const char *path, GCodePreviewData *preview_
|
||||
m_analyzer.reset();
|
||||
}
|
||||
|
||||
if (rename_file(path_tmp, path) != 0)
|
||||
if (rename_file(path_tmp, path))
|
||||
throw std::runtime_error(
|
||||
std::string("Failed to rename the output G-code file from ") + path_tmp + " to " + path + '\n' +
|
||||
"Is " + path_tmp + " locked?" + '\n');
|
||||
|
||||
Reference in new issue
Block a user