Opened 8 years ago

Closed 7 years ago

#7 closed defect (fixed)

Problem readining 2D NX_CHAR data with Nexus3.0.0

Reported by: Tieman Owned by:
Priority: major Milestone: NeXus 4.0 Ready
Component: Version:
Keywords: NX_CHAR Cc: Mark.Koennecke@…

Description

I have about 1 gagillion files created with Napi1.3.2 that wrote a file name list as a 2D NX_CHAR array to the HDF4 format files.

While upgrading my code to Nexus3.0 it was discovered that I can no longer read these files. The new version of napi.c appears to limit the reading of NX_CHAR arrays to 1 dimension.

<snip>

NXstatus CALLING_STYLE NXgetinfo (NXhandle fid, int *rank,

int dimension[], int *iType)

...

if ( (*iType == NX_CHAR) && (*rank > 1) )
{
NXIReportError(NXpData,

"WARNING: multi-dimensional character arrays are not really supported");

}

...
</snip>

I have not been able to deternin if the same restriction applies to writing files--if so, that would need to be fixed as well...

This bug is preventing me from upgrading to newer releases of Nexus.

Attachments (2)

sample02.hdf (72.6 KB) - added by Tieman 8 years ago.
Sample file with 2D NX_CHAR fields that I can no longer read with Nexus3.0.0
nxbrowse_crash.txt (11.8 KB) - added by Freddie Akeroyd 8 years ago.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by Tieman

Sample file with 2D NX_CHAR fields that I can no longer read with Nexus3.0.0

comment:1 Changed 8 years ago by Freddie Akeroyd

  • Cc Mark.Koennecke@… added

Brian,

If I open the path /experiment/reconstruction/slices from your sample file with the NXbrowse utility (which needed modifying first as per ticket #8) and do a DIR I get a crash. If i use valgrind the program does not crash, but i get a large error dump (attached). I've Cc:ed Mark Koennecke on this ticket as he is more familiar with the low level HDF API and may be able to shed some light on the problem

Regards,

Freddie

Changed 8 years ago by Freddie Akeroyd

comment:2 Changed 8 years ago by Freddie Akeroyd

Brian,

I think the problem is due to an error in the way the API tries to strip whitespace on strings - try opening the file with the flags NXACC_READ|NXACC_NOSTRIP

Regards,

Freddie

comment:3 Changed 7 years ago by Freddie Akeroyd

(In [852]) Add in support for two dimensional character arrays to HDF5.
HDF already supported them, but this code was disabled.
NXbrowse also updated to print out these arrays and the
XML API returns an error message if you try to create them.
NXgetslab needs some more work to function properly on
string arrays with the HDF5 interface, but NXgetdata works fine.
Note that whitespace stripping is disabled for multi-dimensional
character arrays.
refs #7

comment:4 Changed 7 years ago by Peter Peterson

  • Milestone set to NeXus 4.0
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.