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

Home » Public Forums » archive » Re: 2 questions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: 2 questions [message #26300] Fri, 17 August 2001 19:33
Bob Fugate is currently offline  Bob Fugate
Messages: 18
Registered: March 2001
Junior Member
I have solved my problem with archived files. My administrator changed an
option on the server that makes the size of the files 0KB if they are on the
tape library. I can now request file size using FILE_TEST without opening
the file (thus not disturbing it if on tape) and easily make a list of files
to defer for later processing.

Alex, Thanks for the suggestion of using GOTO. I have been told for years
by professional programmers to avoid using a GOTO statement with the utmost
resolve. So naturally, your suggestion never occurred to me. Of course, it
would not have occurred to me even if I had not been told GOTO is bad
practice.

Bob Fugate

> From: "Pavel A. Romashkin" <pavel.romashkin@noaa.gov>
> Organization: NOAA-CMDL-CIRES
> Newsgroups: comp.lang.idl-pvwave
> Date: Thu, 16 Aug 2001 10:16:36 -0600
> Subject: Re: 2 questions
>
> Alex Schuster wrote:
>>
>> bla
>> GOTO, LABEL
>> bla
>> blabla
>> blablabla
>> LABEL:
>> blalallla
>
> Hey! This is copyright infringement. Only my code is allowed to look
> like this!
>
> Cheers,
> Pavel
Re: 2 questions [message #26311 is a reply to message #26300] Thu, 16 August 2001 12:27 Go to previous message
Jeff Guerber is currently offline  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
Re: 2 questions [message #26314 is a reply to message #26311] Thu, 16 August 2001 09:16 Go to previous message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
Alex Schuster wrote:
>
> bla
> GOTO, LABEL
> bla
> blabla
> blablabla
> LABEL:
> blalallla

Hey! This is copyright infringement. Only my code is allowed to look
like this!

Cheers,
Pavel
Re: 2 questions [message #26315 is a reply to message #26314] Thu, 16 August 2001 05:24 Go to previous message
Richard French is currently offline  Richard French
Messages: 173
Registered: December 2000
Senior Member
Bob Fugate wrote:

> 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.
>

Another possibility is not to use HDF_ISHDF as the first line of defense
-
I am not familiar with the formats of HDF files, but if there is a
unique
set of bits or bytes at the start of the file that clearly designates
that it is supposed to be an HDF file, then you can write your own very
simple check program to read the start of the file and see if it is in
that format. Reading the file will trigger the restore command from
tape,
as you describe it. Perhaps instead of checking to see if it is an HDF
file,
you can check to see if it is a stub file, either by determining the
size
of the file or, if there is a unique format to the stub file, seeing if
the
contents of the file match that pattern instead of the HDF format.

Dick French
Re: 2 questions [message #26316 is a reply to message #26315] Thu, 16 August 2001 04:24 Go to previous message
Alex Schuster is currently offline  Alex Schuster
Messages: 124
Registered: February 1997
Senior Member
Bob Fugate wrote:

> Question 2: I am using IDL on 2 platforms: MacOS and Windows NT, both
> versions 5.4. On the Mac, there is a feature that lets one select any number
> of lines in the editor and comment them all out in one command (and
> subsequently uncomment them when needed)--- a very valuable feature for
> someone like me who is not proficient at programming. I can't find this
> feature in the Windows version. Am I missing it somehow? Any suggested
> approaches short of saving the file under a new name and deleting lines in
> that file?

Instead of using comments like here:

bla
; bla
; blabla
; blablabla
blalallla

you could use the GOTO statement:

bla
GOTO, LABEL
bla
blabla
blablabla
LABEL:
blalallla


Alex
--
Alex Schuster Wonko@planet-interkom.de
alex@pet.mpin-koeln.mpg.de
Re: 2 questions [message #26317 is a reply to message #26316] Thu, 16 August 2001 01:40 Go to previous message
Nigel Wade is currently offline  Nigel Wade
Messages: 286
Registered: March 1998
Senior Member
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.
>


Is there some feature of the stub files which you could test before
calling HDF_ISHDF? Perhaps the length, or the first few bytes of the
contents.

Then you could use logic like:

for each file
test file
if stub
add file to list of deferred files
else
HDF_ISHDF file


This way you avoid calling HDF_ISHDF for the stub files.

--
-----------------------------------------------------------
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523568, Fax : +44 (0)116 2523555
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: mpeg movie problem solved
Next Topic: a newbie question on code efficiency

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

Current Time: Wed Oct 08 15:09:52 PDT 2025

Total time taken to generate the page: 0.00623 seconds