When renaming the exported G-code (removing the .tmp suffix), some other application (thank you, Windows Explorer) may keep the file locked. Try to wait a bit and then rename the file again. by @bubnikv

This commit is contained in:
Alessandro Ranellucci 2017-03-01 17:26:55 +01:00
parent d984864ce0
commit 7ad5b56b9f

View File

@ -101,7 +101,16 @@ sub export_gcode {
# close our gcode file
close $fh;
rename Slic3r::encode_path($tempfile), Slic3r::encode_path($output_file) if $tempfile;
if ($tempfile) {
my $renamed = 0;
for my $i (1..5) {
last if $renamed = rename Slic3r::encode_path($tempfile), Slic3r::encode_path($output_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 $output_file. Is $tempfile locked?\n"
if !$renamed;
}
}
# run post-processing scripts