R
Roedy Green
I compress a large number of files to create a ZIP backup on DVD and
USB flash drive. I do it from scratch each day to avoid accumulating
deadwood.
I have repeatedly asked the WinZip people to provide a way to prune
ZIP files of members that no longer exist. They have always refused
saying I was the only one asking. If they would comply, I could do an
update/prune rather than compressing the entire set from scratch, a
very time-consuming process.
I thought to myself. I need to write a utility to do this. I started
thinking about how to do it efficiently. Here are some of the ideas I
had:
1. create a list of files that need to be pruned and feed it to WinZip
as an @list and trust it to prune efficiently.
2. Use the JAVA zip API to delete, and trust it to wait until a batch
of deletes are all specified before writing a new more compact file
and renaming. (I have not experimented with it to see how bright it
is about multiple deletes from a very large zip file.)
3. Study up on the Zip file format, create new deleted file with just
the kept members and a freshly composed index at the end. This would
be guaranteed to be efficient, would be the most fun, but would take
the longest to code.
Any thoughts?
--
Roedy Green Canadian Mind Products
http://mindprod.com
"Species evolve exactly as if they were adapting as best they could to a changing world, and not at all as if they were moving toward a set goal."
~ George Gaylord Simpson
USB flash drive. I do it from scratch each day to avoid accumulating
deadwood.
I have repeatedly asked the WinZip people to provide a way to prune
ZIP files of members that no longer exist. They have always refused
saying I was the only one asking. If they would comply, I could do an
update/prune rather than compressing the entire set from scratch, a
very time-consuming process.
I thought to myself. I need to write a utility to do this. I started
thinking about how to do it efficiently. Here are some of the ideas I
had:
1. create a list of files that need to be pruned and feed it to WinZip
as an @list and trust it to prune efficiently.
2. Use the JAVA zip API to delete, and trust it to wait until a batch
of deletes are all specified before writing a new more compact file
and renaming. (I have not experimented with it to see how bright it
is about multiple deletes from a very large zip file.)
3. Study up on the Zip file format, create new deleted file with just
the kept members and a freshly composed index at the end. This would
be guaranteed to be efficient, would be the most fun, but would take
the longest to code.
Any thoughts?
--
Roedy Green Canadian Mind Products
http://mindprod.com
"Species evolve exactly as if they were adapting as best they could to a changing world, and not at all as if they were moving toward a set goal."
~ George Gaylord Simpson