zip-archive icon indicating copy to clipboard operation
zip-archive copied to clipboard

Safe operations for Entry values

Open mpolney opened this issue 8 years ago • 1 comments

I think it would be useful to be able to modify Entry safely. I need to read all the entries out of an archive and change the pathnames. Currently I'm doing this with eRelativePath, but that seems to be unsafe, since the library internally uses the trailing "/" as a marker for directories.

This is important in my use case, because I am using OptRecursive to add a directory full of files, and then trimming all the paths in the entries. When using OptRecursive with addaddEntryToArchive on a directory, the directory is given an entry in the archive of its own. During my path trimming, the trailing slash happens to be eliminated, which -- as far as the library is concerned -- turns the directory entry into a file entry. Then, when I write out the archive, I end up with a blank file with the same path and filename as the directory.

mpolney avatar Sep 27 '16 13:09 mpolney

I had to revert this change because of problems it caused.

jgm avatar Jun 04 '17 11:06 jgm