Unix archive (*.a) packer plugin for Total Commander
Moderators: Hacker, petermad, Stefan2, white
Unix archive (*.a) packer plugin for Total Commander
I would like to announce a plug-in for Total Commander which can extract the files from the GNU style Unix archives.
The plug-in is available under LGPL license.
The plug-in is available under LGPL license.
- fenix_productions
- Power Member
- Posts: 1979
- Joined: 2005-08-07, 13:23 UTC
- Location: Poland
- Contact:
Hi, nmarci, nice plugin. But I have an idea how to expand its functional:)
As I see this format is similar to standard .lib files format (it seems like MS uses it for their .lib files), and your archiver even shows .obj files inside of .lib and allow to extract them. Unfortunately it doesn't allow to extract object files from subfolders of .lib (i.e. when object file name contains slashes). I think you may fix it and tell about .lib support too in topic title.
Also I think it would be great to show files with same names autorenamed (e.g. with appendix "(%d)" where %d is some number e.g. file index in AR header or file offset) so use can extract them from .lib files too (currently it shows many all files with same names but always extracts first of them).
Here a couple of standard .lib files so you may test them with your plugin:
File pgobootrun.lib contains one object file in subfolder (there is some folder structure) and file framedyn.lib contains some files with same names.
As I see this format is similar to standard .lib files format (it seems like MS uses it for their .lib files), and your archiver even shows .obj files inside of .lib and allow to extract them. Unfortunately it doesn't allow to extract object files from subfolders of .lib (i.e. when object file name contains slashes). I think you may fix it and tell about .lib support too in topic title.

Here a couple of standard .lib files so you may test them with your plugin:
(save as .b64 and decode)MIME-Version: 1.0
Content-Type: application/octet-stream; name="lib_samples.7Z"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="lib_samples.7Z"
N3q8ryccAAOyo+75LQgAAAAAAAAiAAAAAAAAANMzNAgAEI8IqBly13UfTQKW4cLI8T+Qv4i6DQ90
VkakPeKMDC0M5hVfH3gGQmJvD4wNJwUX2hOwful7jYsT5/zB6kxQHcQ5CFw4DgAlXD9lwzii/TQ1
IdEEAgr+bpGSqTUG66loVh9VW/Oju1SUMRjiJaBc8SIKk267T96MY+VNZiYpEBcYfEE+9FxjWYmw
NhDSvY1Q7WEwlfQ6w6QncYTifz7bvGbFLtj1b68qCv0WkLQxJT3kh7Ka8LQV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V2OQyWm2c2TYD15N7NVEgA7DNk
nsgV85VMgmB7nPD11bTe3rWfZ/OF+55kmB/CR5HujHCvw3luRybIpNFB4s/OrlEcXl4m75XOKWvg
GFgfPWRcF9AjTfthoqAWWDguEZGEpFkRFOXVfujdzF7wHI1ESzybcq9qYVfUhkg1r4PkBGPRJ4fJ
gYsmY8x4TfJECNQ1+S6h2b1ZuceZYS5qjNOlRmGT3wy5XPFQ3RzawmDAU6hlKQL7UIIGqa2c175Y
TYWE2f3iAACBMweuD9V9wOlXJNP+s34viZK+vj0KsZCw8Rz0bvjgNMZGhvL6q2jOgmZOiVkBatRB
8P1ks1uhfqLY/IxRTXyZZJrPGUwzWqfFr5M88wWHSfb/r1gEFiTEnn1Tdqi6pt2Xx6/c/yTK8qxj
4W02VVVo7UzdvCcDdeEAABcGh7EBCXwABwsBAAEjAwEBBV0AEAAADICNCgGC7zi4AAA=
File pgobootrun.lib contains one object file in subfolder (there is some folder structure) and file framedyn.lib contains some files with same names.
Unix archive with same filenames inside
ThanksMVV wrote:Hi, nmarci, nice plugin.

I had some time time to look at one of your comments:
I could reproduce the problem you mentioned. I could even create a simple test file which contains three files, each named "a". The contents of the files are different and even there is two files which has exactly the same size.MVV wrote:Also I think it would be great to show files with same names autorenamed (e.g. with appendix "(%d)" where %d is some number e.g. file index in AR header or file offset) so use can extract them from .lib files too (currently it shows many all files with same names but always extracts first of them).
In the Packer plugin Interface Description 2.21, chapter ProcessFile() the following can be read:
If TotalCommander 7.55a worked as described the plugin would work. However, TotalCommander stops at the first matching filename and tries to extract that file. I think this problem is to be solved in Total Commander.When Total Commander first opens an archive, it scans all file names with OpenMode==PK_OM_LIST, so ReadHeader() is called in a loop with calling ProcessFile(...,PK_SKIP,...). When the user has selected some files and started to decompress them, Total Commander again calls ReadHeader() in a loop. For each file which is to be extracted, Total Commander calls ProcessFile() with Operation==PK_EXTRACT immediately after the ReadHeader() call for this file. If the file needs to be skipped, it calls it with Operation==PK_SKIP.
Here is the bash script I used to generate my test.a file:
Code: Select all
#!/bin/sh
mkdir x
echo First one >x/a
ar q test.a x/a
echo Second one, a longer text >x/a
ar q test.a x/a
echo Third. >x/a
ar q test.a x/a
echo 4th, same size as second. >x/a
ar q test.a x/a
rm -f x/a
rm -r -f x
Code: Select all
MIME-Version: 1.0 (mime-construct 1.11)
Content-Disposition: attachment; filename=test.a
Content-Type: application/octet-stream; name=test.a
Content-Transfer-Encoding: base64
ITxhcmNoPgphLyAgICAgICAgICAgICAgMTI4NzM0NTI2NyAgMTAwMCAgMTAwMCAgMTAwNjQ0ICAx
MCAgICAgICAgYApGaXJzdCBvbmUKYS8gICAgICAgICAgICAgIDEyODczNDUyNjcgIDEwMDAgIDEw
MDAgIDEwMDY0NCAgMjYgICAgICAgIGAKU2Vjb25kIG9uZSwgYSBsb25nZXIgdGV4dAphLyAgICAg
ICAgICAgICAgMTI4NzM0NTI2NyAgMTAwMCAgMTAwMCAgMTAwNjQ0ICA3ICAgICAgICAgYApUaGly
ZC4KCmEvICAgICAgICAgICAgICAxMjg3MzQ1MjY3ICAxMDAwICAxMDAwICAxMDA2NDQgIDI2ICAg
ICAgICBgCjR0aCwgc2FtZSBzaXplIGFzIHNlY29uZC4K
Code: Select all
$ ar tv test.a
rw-r--r-- 1000/1000 10 Oct 17 21:54 2010 a
rw-r--r-- 1000/1000 26 Oct 17 21:54 2010 a
rw-r--r-- 1000/1000 7 Oct 17 21:54 2010 a
rw-r--r-- 1000/1000 26 Oct 17 21:54 2010 a
Bug report filed for packer plugin
I filed a bug report Packer plugin: more than one file with the same name for this problem.
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Indeed TC currently recognizes files in packer plugins by name, so it's not a good idea to have multiple with the same name. You should consider to name them e.g. name, name(1), name(2) etc.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com