Use a local tmp file for plotting

Fix #5238
This commit is contained in:
Marek Roszko 2020-08-19 23:46:25 -04:00 committed by Mark Roszko
parent c14065ee98
commit de7a1b647c
2 changed files with 3 additions and 4 deletions

View File

@ -186,9 +186,8 @@ bool GERBER_PLOTTER::StartPlot()
finalFile = outputFile; // the actual gerber file will be created later finalFile = outputFile; // the actual gerber file will be created later
// Create a temporary filename to store gerber file // Create a temp file in system temp to avoid potential network share buffer issues for the final read and save
// note tmpfile() does not work under Vista and W7 in user mode m_workFilename = wxFileName::CreateTempFileName( "" );
m_workFilename = filename + wxT(".tmp");
workFile = wxFopen( m_workFilename, wxT( "wt" )); workFile = wxFopen( m_workFilename, wxT( "wt" ));
outputFile = workFile; outputFile = workFile;
wxASSERT( outputFile ); wxASSERT( outputFile );

View File

@ -556,7 +556,7 @@ int PDF_PLOTTER::startPdfStream(int handle)
"stream\n", handle + 1 ); "stream\n", handle + 1 );
// Open a temporary file to accumulate the stream // Open a temporary file to accumulate the stream
workFilename = filename + wxT(".tmp"); workFilename = wxFileName::CreateTempFileName( "" );
workFile = wxFopen( workFilename, wxT( "w+b" )); workFile = wxFopen( workFilename, wxT( "w+b" ));
wxASSERT( workFile ); wxASSERT( workFile );
return handle; return handle;