mdfreader icon indicating copy to clipboard operation
mdfreader copied to clipboard

write only file_meta to existing mdf file

Open skidzo opened this issue 6 years ago • 5 comments

How can I write only updated file_metadata dict from read file to same existing file without having to read in any other data?

skidzo avatar Mar 19 '18 17:03 skidzo

This is more a feature request somehow...

skidzo avatar Mar 19 '18 19:03 skidzo

I am not sure to understand exactly but I guess you want a specific method to write only metadata in file ? Currently, if you give the filename as argument in write method, it will overwrite the complete file with the mdf object/metadata/data in memory (size might inflate) For mdf 3.x, this should be relatively easy, metadata being in header block. However, more complicated for mdf4.x as there are metatadata in all kind of blocks with variable lengthes, easier to rewrite the file.

ratal avatar Mar 19 '18 21:03 ratal

actually I just want to (over) write one metadata item e.g a hash key into the existing mdf file, no matter if i have to rewrite it or not.

skidzo avatar Mar 20 '18 08:03 skidzo

we have made a function to do that for mdf 3.x, only for mdf 4.x upwards compatibility it would be nice to implement this inside mdfreader. For now there is no urgent need for that. Thanks for your fast reply!

skidzo avatar Mar 20 '18 15:03 skidzo

Sort of on a related note: when converting and mdf4 to mdf3 file (or vise versa) - is it possible to retain the meta data (e.g., comments, project info, start/stop time, etc...) in the new output file?

Thanks!

ecalpy avatar Sep 09 '21 00:09 ecalpy