When reading a file with one or more truncated data records, we currently emit a warning and store the corrected number of records in the header as though that's what we had been given all along. However, this is not programmatically discoverable. Knowing after the fact that the input was truncated is worthwhile when auditing incoming data and when converting to a different format (cf. https://github.com/beacon-biosignals/OndaEDF.jl/issues/59).
Some ways to go about this:
Store the number of unread bytes somewhere, e.g. as a field in the File or FileHeader type. This would be 0 for untruncated files.
Add a field to the FileHeader alongside record_count to denote the original, incorrect record count that got corrected on read.
When reading a file with one or more truncated data records, we currently emit a warning and store the corrected number of records in the header as though that's what we had been given all along. However, this is not programmatically discoverable. Knowing after the fact that the input was truncated is worthwhile when auditing incoming data and when converting to a different format (cf. https://github.com/beacon-biosignals/OndaEDF.jl/issues/59).
Some ways to go about this:
File
orFileHeader
type. This would be 0 for untruncated files.FileHeader
alongsiderecord_count
to denote the original, incorrect record count that got corrected on read.There are probably other ways too.