Inconsistent problem of HDF I/O [message #33038] |
Wed, 27 November 2002 08:02  |
K.Y.Choi
Messages: 4 Registered: April 2002
|
Junior Member |
|
|
Hello
I've got HDF files that have been created with NCSA HDF Version 3.3
Release 3, February 1994. It contains several VGroups and one or two
SD objects. I wrote an IDL code for the HDF file I/O, that extracts
some file information from VGroups, as well as image data in SD
objects.
My routine has inconsistant problem, that is, when I tried to run my
code to open a file, it some times yields error message like
% HDF_CLOSE: Failed to close file (�).
In parentheses, it shows funny ASCII shapes, such as � shape or |
shape. With or without recompiling, it *sometimes* works after a
couple of trials for the same file. The file has no problem whatsoever
with HDF_BROWSER, indicating that the HDF file is fine.
Only solution I can think of was to seperate HDF_OPEN - HDF_CLOSE from
HDF_SD_START - HDF_SD_ENDACCESS - HDF_SD_END. Hence structure of my
code is as follows,
HDF_OPEN
:
access VGroup
:
HDF_CLOSE
HDF_SD_START
:
access SD
:
HDF_SD_ENDACCESS
HDF_SD_END
HDF_OPEN
:
access VGroup
:
HDF_CLOSE
The error always points HDF_CLOSE at the end of the routine
I thought (still think) HDF_OPEN - HDF_CLOSE and HDF_SD_START -
HDF_SD_ENDACCESS - HDF_SD_END behave exactly like OPENR /GET_LUN -
FREE_LUN. But they don't?
Should I blame a guy who creats the HDF file or IDL or myself? How am
I improve my routine as solid as BMW?
I look forward to hearing from you guys soom. Please share your wisdom
and experience...
Thanks
Reno
|
|
|
|
Re: Inconsistent problem of HDF I/O [message #85290 is a reply to message #85288] |
Mon, 22 July 2013 11:49  |
MarioIncandenza
Messages: 231 Registered: February 2005
|
Senior Member |
|
|
On Monday, July 22, 2013 11:15:28 AM UTC-7, Edward Hyer wrote:
> I have just been bitten by this problem. The file passes HDF_ISHDF() and HDF_OPEN(), but HDF_CLOSE gives an error. No SD or VG or any kind of access statement between HDF_OPEN() and HDF_CLOSE() is required to give this error. Any other tests people use out there that can catch a bad HDF before it breaks IDL?
The file does cause 'ncdump' to fail. So my worst-case scenario is to add another layer of checks with 'ncdump,' but I'd be much happier if there was a check I could do within IDL.
|
|
|