Ticket #159 (new defect)
Writing attributes before data may cause data write to fail
| Reported by: | Mlesha | Owned by: | Mark Koennecke |
|---|---|---|---|
| Priority: | minor | Milestone: | NeXus 4.2 Release |
| Component: | napi | Version: | 4.2rc2 |
| Keywords: | Cc: |
Description
Calling NXputattr before NXputdata can cause the NXputdata to fail with message ‘No dataset open’ and all 0’s are written to the data file instead of the data. Failure depends on the specific combination of attributes written, and was observed while writing uncompressed XML files but could affect other types. The problem does not occur if all NXputdata are done before NXputattr calls. There is no indication in the API documentation that this order needs to be followed (apart from the example) – either this is an API bug or the documentation needs to include a note that this order needs to be enforced (it is counter-intuitive since in XML output the attributes precede the data).
