Catching I/O errors on RESTORE [message #29706] |
Fri, 08 March 2002 10:46 |
MKatz843
Messages: 98 Registered: March 2002
|
Member |
|
|
Here's in I/O error-trapping question for the IDL gurus out there...
Working in IDL 5.4 on SunOS UNIX, I'd like to catch errors
that occur when reading a bad or incomplete--but existing--
IDL SAVE file. I want to use ON_IOERROR, but it doesn't
seem to catch errors that occur with the RESTORE function.
Here's more information...
I create a smallish (100-200 bytes) disk file with
SAVE, x, y, z, filename="myfile.dat"
Since I have lots of programs running simultaneously, different
parts of my program or different IDL sessions may be
SAVEing and RESTOREing these files in quick succession.
Before I RESTORE, I always check for the existence of the file with
FRELUN, 10
OPENR, 10, filename, ERROR=err
Sometimes, the file exists but is empty (!), then IDL tries to RESTORE
and comes back with an END OF FILE error.
SO, I put in an error catcher:
ON_IOERROR, error_label
Yet the program still halts with an END OF FILE, and the error
trap is never activated. Any ideas?
I would like the RESTORE file to trip the error trap and go
nicely to my error-handling code.
Thanks, MKatz
|
|
|