Can I store a file (HDF5 file) in another file with serialization?

↘锁芯ラ 提交于 2020-01-05 04:41:10

问题


I have a HDF5 file and a list of objects that I need to store for saving functionality. For simplicity I want to create only one save file. Can I store H5 file, in my save file that I create with serialization (pickle) without opening H5 file.


回答1:


You can put several files in one by using zipfile or tarfile

  • for zipfile you would write the database files and writestr your pickle.dumpsed data.
  • for tarfile you would add the database file and gettarinfo, addfile your pickle.dumped data from a file.

I would suggest creating a zip if you do not need extended filesystem-attributes because it is a bit easier to use.



来源:https://stackoverflow.com/questions/39369671/can-i-store-a-file-hdf5-file-in-another-file-with-serialization

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!