Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. qCompress
Qt 6.11 is out! See what's new in the release blog

qCompress

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 4 Posters 1.9k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    U7Development
    wrote on last edited by
    #1

    Hi!..

    how can I use qCompress to compress multiple files and directories?

    i currently have this:

    ./content.dat (which is a html document)
    ./images/0.jpg
    ./images/1.jpg

    i'm looking for compressing these 3 files keeping their directory hierarchy.

    I could use a non orthodox way using system terminal tar or gzip, but qCompress seems to be more ellegant..

    thanks in advance.

    raven-worxR 1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      qCompress does not support this nor does gzip. If you want to create an archive you have to use other libraries.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        I think you should consider the use of KDE's KArchive for that task.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • U U7Development

          Hi!..

          how can I use qCompress to compress multiple files and directories?

          i currently have this:

          ./content.dat (which is a html document)
          ./images/0.jpg
          ./images/1.jpg

          i'm looking for compressing these 3 files keeping their directory hierarchy.

          I could use a non orthodox way using system terminal tar or gzip, but qCompress seems to be more ellegant..

          thanks in advance.

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by raven-worx
          #4

          @U7Development said in qCompress:

          but qCompress seems to be more ellegant

          i disagree, but if you really want i would go this way:
          use QDataStream to create a QByteArray which contains a QString (path) and another QByteArray (filedata) (for each file). The final bytearray can be compressed.
          Use the same way to uncrompress.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          1
          • U Offline
            U Offline
            U7Development
            wrote on last edited by
            #5

            thanks. i will go for karchive then..

            greetings

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved