Added some error checking to ensure file is created
Added some error checking to ensure file is created

paolap/cwsl-ctools,paolap/cwsl-ctools,ccarouge/cwsl-ctools,ccarouge/cwsl-ctools,CWSL/cwsl-ctools,CWSL/cwsl-ctools,CWSL/cwsl-ctools