Detection of nested archives

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
gikar
Junior Member
Junior Member
Posts: 3
Joined: 2004-10-18, 15:09 UTC

Detection of nested archives

Post by *gikar »

Hi all,

I have a question regarding TC's handling of nested archives.

I have a WAR file inside an EAR file (i.e. a typical J2EE enterprise archive file). WAR, EAR and JAR archives are nothing more than specialized ZIP files. When <enter>ing the WAR inside TC, TC treats it - correctly - as a ZIP file, and opens it as a directory. However, when I attempt to <enter> the nested WAR file (which is now visible as a normal file), TC asks if the WAR file should be unpacked and executed.

When the WAR file in question is *not* nested, TC treats it, again correctly, as a ZIP file and opens it as a directory.

Also, in the case of nested ZIP files, TC works like a charm. It "detects" the nested ZIP file and opens it as a directory.

I wonder if my environment is at fault or if TC does not use the same archive detection policy when a ZIP-compatible archive is nested than when it is not. I should probably also point out that in my environment no applications are associated with JAR, EAR or WAR files .

Has anyone else experienced the same problem? And is anyone aware of a way round this "issue"?
Last edited by gikar on 2004-10-18, 21:49 UTC, edited 1 time in total.
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

I think this is because for TC to detect the archive type inside of a zip, it has to extract the file first. TC detects the type of an unknown type by opening the file and reading the contents. This is not possible inside of an archive (well, it is, but only by extracting it).
I switched to Linux, bye and thanks for all the fish!
User avatar
gikar
Junior Member
Junior Member
Posts: 3
Joined: 2004-10-18, 15:09 UTC

Post by *gikar »

Thanks SanskritFritz, this does make sense.

So, it seems that TC detects nested ZIP files by the extension rather than by format. But it would be handy if the list of detected extentions was user configurable, e.g. in the ini file.

So, is there a formal way to submit a feature request like this one?
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

Cannot exactly tell which way TC handles nested files. A workaround is to press [Ctrl]+[PgDn] on the *war file to switch into it. When I rename a zip to war and nest it into anothe zip I getthe same 'unpack and start?' dialog but if I click yes TC does not unpack it properly.

As far as I know TC does not open the zip file but reads only the 'zip directory' to display the information. Thus you can look inside scrambled zip's but not access the fiels in it without password.
So TC finds in the nested zip a file that is not associated to any prog and thus TC does not know what to do with it. If the *.war is unpacked TC looks inside for a known signature and finds it is zip -so it can use the internal zip unpack routine to swith into it.

HTH sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
gikar
Junior Member
Junior Member
Posts: 3
Joined: 2004-10-18, 15:09 UTC

Post by *gikar »

Neat, Sheepdog. [Ctrl+PgDn] is exactly the workaround I am looking for.

Concerning nested archive detection, as I said, I think TC looks for the extension of a nested archive, rather than at its format. So, TC "detects" a nested ZIP file by virtue of the file's extension. Now, If we could just edit the list of extensions TC uses to "detect" nested archives, there should be no problem when <enter>ing such a file.
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

[mod]BTW: It would be nice if you could rephrase your thread title to something more descriptive, for example "Nested archives" or something similar. You can change the thread title by editing your first post.

Thanks
Hacker (Moderator)[/mod]
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Post Reply