Bug report #9940
Save to File from Print Layout silently fails when file is open in another application.
|Affected QGIS version:||2.0.1||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||duplicate|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||18444|
The issue is that you go 'save to PDF' and it works away, and seems to work, but if the file is open in another application it silently fails.
What needs to happen is like this (in Python code):
fExists = os.access(outFile, os.F_OK)
fAccess = os.access(outFile, os.X_OK)
if(fExists and not fAccess):
QMessageBox.information(None, "Error", 'Can\\'t write file as it\\'s open in another program. Please close the file or choose a different target.')