comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Catching I/O errors on RESTORE
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Catching I/O errors on RESTORE [message #29698 is a reply to message #29688] Sat, 09 March 2002 23:40 Go to previous messageGo to previous message
alt is currently offline  alt
Messages: 28
Registered: August 2001
Junior Member
I have the similar problem while organizing simple IDL client-server
applications. Suppose client is trying to read sav-file before server
end up with writing...

Some possible useful ideas:
* CATCH (not ON_IOERROR) catches all errors including RESTORE errors
(unfortunately not all)
* FILE_TEST() checks file existence without opening it.
* file size can be obtained via (FSTAT(f)).SIZE
* FILE_INFO() (only in IDL 5.5) can get file size without opening it.
* sometimes (very rare) RESTORE can not restore all saved variables
and restore only part of them messaging "Truncating..." and CATCH does
not catch this situation (AFAIK). So I recommend to use CMSVLIB
library of Craig B. Markwardt
(http://cow.physics.wisc.edu/~craigm/idl/cmsave.html) which he kindly
grants to IDL community.

Best regards,
Altyntsev Dmitriy
Remote Sensing Center, ISTP
Irkutsk, Russia
http://ckm.iszf.irk.ru

MKatz843@onebox.com (M. Katz) wrote in message news:<4a097d6a.0203081046.1deaf7e@posting.google.com>...
> 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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Memory Problems
Next Topic: Visual C++ compiler option for >1GB of memory

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 03:03:28 PDT 2025

Total time taken to generate the page: 1.91435 seconds