En/na Enigma Curry ha escrit:: > I need to store a large number of files in an archive. From Python, I > need to be able to create an archive, put files into it, modify files > that are already in it, and delete files already in it. >[...] > Is there any archive format that can allow Python to modify a file in > the archive *in place*? That is to say if my archive is 2GB large and I > have a small text file in the archive I want to be able to modify that > small text file (or delete it) without having to rewrite the entire > archive to disk. >[...]
Although it is not its main usage, PyTables_ can be used to store ordinary files in a single HDF5_ file. HDF5 files have a hierarchical structure of nodes and groups which maps quite well to files and directories. You can create, read, modify, copy, move and remove nodes at will, freed space is reclaimed, and HDF5 is very efficient no matter how large data is. For working with the files, PyTables includes a FileNode_ module which offers Python file semantics for nodes in an HDF5 file. You can also keep nodes transparently compressed, or you may repack the whole HDF5 file to defragment it or (de)compress its nodes, which may make a reasonable option to a compressed archive. I will be pleased to give more information. Hope that helps. .. _PyTables: http://www.pytables.org/ .. _HDF5: http://hdf.ncsa.uiuc.edu/HDF5/ .. _FileNode: http://pytables.sourceforge.net/html-doc/usersguide6.html import disclaimer :: Ivan Vilata i Balaguer >qo< http://www.carabos.com/ Cárabos Coop. V. V V Enjoy Data ""
signature.asc
Description: OpenPGP digital signature
-- http://mail.python.org/mailman/listinfo/python-list