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

Home » Public Forums » archive » reading multiple HDF files
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: reading multiple HDF files [message #61381 is a reply to message #61338] Wed, 16 July 2008 08:27 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Here is the code I used to test this. I can run as many as
> I like with the HDF_SD_END in the code, but only 32 without
> it. :-)

Here is my theory. Suppose you open a file with
a command like this:

OPENR, lun, filename, /Get_LUN

If you close the file like this:

CLOSE, lun

You have closed the file, but you have not released the
logical unit number to be used over again. Since there
are only 32 of these "managed" logical unit numbers, if
you were opening files in a loop, you would run out after
32 iterations. You need to also free the logical unit
number to be used over again:

FREE_LUN, lun

(Fortunately, in this case FREE_LUN also closes the file, so you
don't need to use both of these commands. But I see a LOT of
people using CLOSE when they should be using FREE_LUN.)

That is what is happening here, I think.

HDF_SD_ENDACCESS is equivalent to CLOSE
HDF_SD_END is equivalent to FREE_LUN

So, when you are working with HDF files, you *must* use both.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: help about annotate
Next Topic: merge data-array with calender-date-array

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

Current Time: Sun Oct 12 16:33:08 PDT 2025

Total time taken to generate the page: 0.00217 seconds