Correctly rename g-code file once it is generated.
This commit is contained in:
parent
80f345d7c1
commit
46fc4a0a8e
1 changed files with 9 additions and 1 deletions
|
@ -101,7 +101,15 @@ sub export_gcode {
|
||||||
|
|
||||||
# close our gcode file
|
# close our gcode file
|
||||||
close $fh;
|
close $fh;
|
||||||
rename $tempfile, $output_file if $tempfile;
|
if ($tempfile) {
|
||||||
|
my $i;
|
||||||
|
for ($i = 0; $i < 5; $i += 1) {
|
||||||
|
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 "Failed to remove the output G-code file from $tempfile to $file. Is $tempfile locked?\n" if ($i == 5);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# run post-processing scripts
|
# run post-processing scripts
|
||||||
|
|
Loading…
Reference in a new issue