ratal / mdfreader

Read Measurement Data Format (MDF) versions 3.x and 4.x file formats in python
Other
169 stars 74 forks source link

write only file_meta to existing mdf file #137

Open skidzo opened 6 years ago

skidzo commented 6 years ago

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 commented 6 years ago

This is more a feature request somehow...

ratal commented 6 years ago

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.

skidzo commented 6 years ago

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 commented 6 years ago

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!

ecalpy commented 2 years ago

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!