[clue] Unzipping zip archives with duplicates?
Sean LeBlanc
seanleblanc at comcast.net
Tue Sep 4 10:05:13 MDT 2012
On 8/29/12 7:33 PM, David L. Anselmi wrote:
> Sean LeBlanc wrote:
>> Yes, the files in the zip have paths. So, the problem I was running into
>> if I *only* considered uniqueness by the entire path was this:
>>
>> /foo<- Actually a FILE
>> /foo/<- Actually a DIR
>> /foo/file1
>> /foo/file2... etc.
> Ugh, that's brain damaged. Are there any file systems where you can have a file and dir with the
> same name? Or are they creating the zip from some broken code?
None that I'm aware of. Unfortunately, this sort of brain damage seems
to be par for the course for this particular product. I think they
thought that just because they "can" produce a file like this, that it
then became a good idea. I think they are just dumping out a
database-like structure to a file-based structure.
You had some interest in Plan 9, right? Do they support it?
>
>> Turns out now I'm trying to figure out how to have my Ruby script
>> embedded in Ant be able to find the gems it needs....I might end up
>> re-writing the Ruby script in Groovy instead. :)
> I looked at Groovy a bit--I wasn't impressed. The argument for using it was that we wanted to parse
> properties files and Java knows how to do that easily. So in a Java environment it might come in
> handy (especially if you have people who can't learn new languages). But the script I saw was badly
> done and not nearly as easy to reuse as I needed.
>
> Does Java/Groovy have a good zip library?
>
I'm a bit biased: I do mostly Groovy on Grails for the day job, and I
think Groovy is great. :)
And yes, it has a good zip library. The idiom for using zip in Groovy is
rather Java-esque, though - unless you want to use metaobject
programming to change the behavior and sort of "add" it to the language:
http://grooveek.blogspot.com/2009/09/adding-zipping-and-unzipping.html
I think if you are already using Java a lot - adding Groovy to the mix
is an easy sell to suits and can gain the tech people a lot of win, IMHO.
If you weren't already in that ecosystem - maybe not as interesting.
More information about the clue
mailing list