mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-12 11:11:50 +08:00
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:
parent
d984864ce0
commit
7ad5b56b9f
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user