Cross platform file archiving

  • Thread starter magnus.moraberg
  • Start date
M

magnus.moraberg

Hi,

I wish to archive and unarchive a set of files in a file archive via
my program. My program is programmed using Qt4. Basically, my program
user will download this file archive from the internet and then my
program should be able to open the file and extract the required
files.

Any ideas on how I should do this from a cross platform point of view
- Win32, Mac Os X and Linux. What file archiving method might I use?

Thanks,

Magnus
 
M

Michael Doubez

Hi,

I wish to archive and unarchive a set of files in a file archive via
my program. My program is programmed using Qt4. Basically, my program
user will download this file archive from the internet and then my
program should be able to open the file and extract the required
files.

Any ideas on how I should do this from a cross platform point of view
- Win32, Mac Os X and Linux. What file archiving method might I use?

There is no standard way to do this. QT bundles a number of libraries
and provides a lot of functionalities, yu may have more responses from
a QT4 related group.

My 2 eurocent:
- libzip is fairly portable and fast (but compression is not
optimal)
- QT4 should provide a good set of network operation (otherwise
libcurl should get you through)
 
J

James Kanze

I wish to archive and unarchive a set of files in a file
archive via my program. My program is programmed using Qt4.
Basically, my program user will download this file archive
from the internet and then my program should be able to open
the file and extract the required files.
Any ideas on how I should do this from a cross platform point
of view - Win32, Mac Os X and Linux. What file archiving
method might I use?

The simple answer is that you should use a defined archive
format which is available on all of the platforms in question.
There are several. Then find a portable library which
implements it.

Note too that you have to consider the portability of the files
in the archive. Nothing binary is likely to be portable, and
for text, you have to consider at least the end of line
conventions on each system. (I've no experience with Mac, but
from what I've seen, most Windows programs, and the libraries
delivered with VC++, can handle files with Unix line endings;
the reverse is NOT true, and Windows line endings can cause
problems when read under Unix.)
 

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

Forum statistics

Threads
473,770
Messages
2,569,585
Members
45,081
Latest member
AnyaMerry

Latest Threads

Top