mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-14 15:51:48 +08:00
Correctly rename g-code file once it is generated.
This commit is contained in:
parent
80f345d7c1
commit
46fc4a0a8e
@ -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…
x
Reference in New Issue
Block a user