Archiving Modules

P

peter

I am writing a small Tkinter utility to control archive files in
multiple formats (mainly for my own amusement and education).
Basically it presents the user with two adjacent listboxes, one with
the contents of the target directory and one with the contents of the
archive. By clicking buttons labelled '<' and '>' the user can copy
files to and from the archive. The actual archiving functionality
derives from the modules zipfile and tarfile.

It all seems to be working fine, but I have two residual queries.
Firstly for the sake of completeness I would like to include .rar
archives, but there doesn't seem to be an equivalent rarfile module.
I use both Windows and Linux on various machines, so need a cross
platform solution which does not depend on external modules. The only
one I have found is at http://pypi.python.org/pypi/rarfile/1.0, but it
seems this does rely on an external module. Is there anything out
there?

Secondly, I found that when extracting zip files, the date stamps were
all reset to the date/time of extraction, whereas for tar files they
retained their original values. This second behaviour seems more
logical, and I have simulated it for the zipfiles by using
zipfile.getinfo to read the original date then os.utime to rewrite
it. It seems rather messy - have I missed something simple like a
flag setting within zipfile?

Peter
 
J

Jorgen Grahn

I am writing a small Tkinter utility to control archive files in
multiple formats (mainly for my own amusement and education).
Basically it presents the user with two adjacent listboxes, one with
the contents of the target directory and one with the contents of the
archive. By clicking buttons labelled '<' and '>' the user can copy
files to and from the archive. The actual archiving functionality
derives from the modules zipfile and tarfile.

It all seems to be working fine, but I have two residual queries.
Firstly for the sake of completeness I would like to include .rar
archives, but there doesn't seem to be an equivalent rarfile module.
I use both Windows and Linux on various machines, so need a cross
platform solution which does not depend on external modules. The only
one I have found is at http://pypi.python.org/pypi/rarfile/1.0, but it
seems this does rely on an external module. Is there anything out
there?

RAR is a proprietary format, which complicates things. For example,
Linux distributions like Debian cannot distribute software which
handles it. If Python included such a module, they'd be forced to
remove it from their version.

I wouldn't encourage its use by writing /more/ software which handles
it. IMHO, archives should be widely readable forever, and to be that
they need to be in a widely used, open format.

/Jorgen
 
P

peter

RAR is a proprietary format, which complicates things. For example,
Linux distributions like Debian cannot distribute software which
handles it.  If Python included such a module, they'd be forced to
remove it from their version.

Good point, and one that I did not appreciate. But there are freeware
applications such as jzip (http://www.jzip.com) which can handle .rar
files, so there must be a way round it.
I wouldn't encourage its use by writing /more/ software which handles
it. IMHO, archives should be widely readable forever, and to be that
they need to be in a widely used, open format.

I agree, but if a file is only available as a rar archive I would like
to be able to extract it without using another 3rd party application.

peter
 
W

Westley Martínez

Good point, and one that I did not appreciate. But there are freeware
applications such as jzip (http://www.jzip.com) which can handle .rar
files, so there must be a way round it.


I agree, but if a file is only available as a rar archive I would like
to be able to extract it without using another 3rd party application.

peter
Freeware is still proprietary software.
 
A

Alexander Kapps

Freeware is still proprietary software.

While I agree with the general refusal of .rar or other non-free
archive formats, a useful archiving tool should still be able to
extract them. Creating them is an other issue.

There is a free (open source) un-rar for Linux which AFAIK can at
least handle .rar archives below v3.

HTH
 
J

Jorgen Grahn

It can be ("freeware" is a vague term). As I understand they situation
here, such software is either in a gray area legally, or the author
has made some kind of special agreement with the RAR people.
While I agree with the general refusal of .rar or other non-free
archive formats, a useful archiving tool should still be able to
extract them. Creating them is an other issue.

There is a free (open source) un-rar for Linux which AFAIK can at
least handle .rar archives below v3.

That's part of my point -- unrar-free is the only decoder free enough
to be distributed by Debian, and yes, it's limited to decoding old
versions or the rar file format. Wikipedia seems to say it was based
on RAR as it looked before some license terms change.

/Jorgen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top