Opened 21 years ago

Last modified 21 years ago

#260 closed defect (fixed)

HDF Created files not flushed on close.

Reported by: warmerdam Owned by: dron
Priority: high Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

Andrey,

I visited Belinda today, and I have been able to put together a program
that reproduces the incompletely written file problem she is encountering.  It
is attached (Gdal_Frank.c).  You will need to alter the path to the input
file but I found that the problem is reproducable on Linux and WinXP with the
current development version of the HDF code.  

Note that the problem is likely related to the use of HDF4ImageDataset::Create()
as opposed to the CopyCreate() path normally used by gdal_translate.  I tried
disabling the CopyCreate() method though and that wasn't enough to produce a 
problem with gdal_translate, so the problem must be fairly subtle.

The data file is a bit big to attach here, so I have placed it at:

  ftp://gdal.velocet.ca/pub/outgoing/PAL_BROWSE_AUG_27_1986.HDF

Attachments (1)

Gdal_Frank.cpp (11.8 KB ) - added by warmerdam 21 years ago.
Code to reproduce bug

Download all attachments as: .zip

Change History (5)

by warmerdam, 21 years ago

Attachment: Gdal_Frank.cpp added

Code to reproduce bug

comment:1 by dron, 21 years ago

I have found the problem. libhdf is sensitive to order of calling SDsetattr()
function for attributes setting and SDwritedata() functions. Now all SDsetattr()
calls moved at FlushCache() method and now test sample works fine.

I shall test this with some more cases and commit the code today evening.

comment:2 by dron, 21 years ago

It seems that problem hidden deeper. I will dig into this further, so for now
nothing changed in HDF4 driver.

comment:3 by dron, 21 years ago

As usual it was a stupid bug which lays on the top. Due to my misunderstanding
the libhdf API SDsetattr() functions was called with wrong count parameter. Now
should be fixed.

comment:4 by warmerdam, 21 years ago

I have verified it works now with the test program.  I will email a new DLL
to Belinda.

Note: See TracTickets for help on using tickets.