mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 20:51:12 -06:00 
			
		
		
		
	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 $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 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 bubnikv
						bubnikv