Re: 2 questions [message #26311 is a reply to message #26300] |
Thu, 16 August 2001 12:27   |
Jeff Guerber
Messages: 41 Registered: July 2000
|
Member |
|
|
On Wed, 15 Aug 2001, Bob Fugate wrote:
> I am batch processing a number of HDF files, saving output to results files.
> I have a short procedure that first checks the validity of the files using
> HDF_ISHDF -- just to avoid file access problems during the main processing
> routines. The files are located on a server, or if old enough, on a tape
> library, with only a stub left on the server. A file on tape opened by
> HDF_ISHDF (or any other routine) is automatically restored from tape to the
> server. The problem is, if the file is on tape, HDF_ISHDF times out before
> the file gets reloaded. HDF_ISHDF fails. I could modify the check routine to
> put these files in a separate list to process on the second pass once the
> files are restored. I don't have a simple way (and apparently not even a
> complicated way) to check on the status of these files to know whether they
> are on the server or in the library.
>
> Question: Is there a better way to handle this? For instance, is there a way
> to extend the time-out period to allow the file to be restored so it can be
> checked and subsequently processed? Is there a way to terminate the
> HDF_ISHDF query before it times out and put this file on a list to process
> in a second batch? Any suggestions greatly appreciated.
I don't know anything about HDF_ISHDF, but perhaps you could do a
simple OPENR, and if it fails (is there a specific error for the
timeout?), wait a while, and keep doing this until it succeeds. Then you
know the file is restored, so close it and do your HDF_ISHDF. Something
like this:
openr, lun, 'filename', /get_lun, error=openerr
while (openerr ne 0) do begin
wait, 10
openr, lun, 'filename', error=openerr
endwhile
;; Now we know the file is on the server
free_lun, lun
result=hdf_ishdf('filename')
(Actually, you'll probably want to limit the number of iterations, in
case the file doesn't exist at all, etc.) Hope this helps.
Jeff Guerber
Raytheon ITSS
NASA Goddard Space Flight Center
Oceans & Ice Branch, code 971
|
|
|