Fixed a bug in renaming a G-code at the end of a G-code export

from .tmp suffix to a non .tmp file on localized Windows.
This commit is contained in:
bubnikv 2017-02-13 15:45:31 +01:00
parent fd54956d70
commit ce8973b33a

View File

@ -421,11 +421,11 @@ sub write_gcode {
if ($tempfile) {
my $i;
for ($i = 0; $i < 5; $i += 1) {
last if (rename $tempfile, $file);
last if (rename Slic3r::encode_path($tempfile), Slic3r::encode_path($file));
# Wait for 1/4 seconds and try to rename once again.
select(undef, undef, undef, 0.25);
}
Slic3r::debugf "Faild t remove the output G-code file from $tempfile to $file. Is $tempfile locked?\n" if ($i == 5);
Slic3r::debugf "Faild to remove the output G-code file from $tempfile to $file. Is $tempfile locked?\n" if ($i == 5);
}
}