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. Implement something like tar archive in windows environment
Forum Updated to NodeBB v4.3 + New Features

Implement something like tar archive in windows environment

Scheduled Pinned Locked Moved General and Desktop
47 Posts 8 Posters 13.8k Views 4 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.
  • ZgemboZ Zgembo

    @VRonin Thank you for the example. I do not need to compress files. I just need to group few files to single archive (no compression) and to move it to another pc.

    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #22

    @Zgembo Take a look at documentation: https://api.kde.org/frameworks/karchive/html/classKTar.html
    Especially "A class for reading / writing (optionally compressed) tar archives."

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    ZgemboZ 1 Reply Last reply
    1
    • jsulmJ jsulm

      @Zgembo Take a look at documentation: https://api.kde.org/frameworks/karchive/html/classKTar.html
      Especially "A class for reading / writing (optionally compressed) tar archives."

      ZgemboZ Offline
      ZgemboZ Offline
      Zgembo
      wrote on last edited by
      #23

      @jsulm said in Implement something like tar archive in windows environment:

      @Zgembo Take a look at documentation: https://api.kde.org/frameworks/karchive/html/classKTar.html
      Especially "A class for reading / writing (optionally compressed) tar archives."

      Thank you for your replay. I am really stuck with this. I have examined this example https://github.com/KDE/karchive/blob/master/examples/tarlocalfiles/main.cpp but when I run this program it asks for bzip2.dll and two more.
      I really do not need to compress files. There is no example of using just KTar without compression.

      JonBJ VRoninV 2 Replies Last reply
      0
      • ZgemboZ Zgembo

        @jsulm said in Implement something like tar archive in windows environment:

        @Zgembo Take a look at documentation: https://api.kde.org/frameworks/karchive/html/classKTar.html
        Especially "A class for reading / writing (optionally compressed) tar archives."

        Thank you for your replay. I am really stuck with this. I have examined this example https://github.com/KDE/karchive/blob/master/examples/tarlocalfiles/main.cpp but when I run this program it asks for bzip2.dll and two more.
        I really do not need to compress files. There is no example of using just KTar without compression.

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #24

        @Zgembo

        KTar allows you to read and write tar archives, including those that are compressed using gzip, bzip2 or xz.

        You may not need to use compression, but that indicates that because the code supports compression you still need to provide the extra DLLs it is asking for. Their code will not get used in your case, but they still need to be present at runtime.

        1 Reply Last reply
        3
        • ZgemboZ Zgembo

          @jsulm said in Implement something like tar archive in windows environment:

          @Zgembo Take a look at documentation: https://api.kde.org/frameworks/karchive/html/classKTar.html
          Especially "A class for reading / writing (optionally compressed) tar archives."

          Thank you for your replay. I am really stuck with this. I have examined this example https://github.com/KDE/karchive/blob/master/examples/tarlocalfiles/main.cpp but when I run this program it asks for bzip2.dll and two more.
          I really do not need to compress files. There is no example of using just KTar without compression.

          VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #25

          @Zgembo said in Implement something like tar archive in windows environment:

          this program it asks for bzip2.dll and two more.

          This is because KArchive can do much more than tar and my pre-compiled version allows you to do that linking to those libraries. They are available in the same link from which you downloaded the KArchive library.
          Linking to those libraries does not mean your tar archive is getting compressed. it just means you have the option to compress it

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          ZgemboZ 1 Reply Last reply
          5
          • VRoninV VRonin

            @Zgembo said in Implement something like tar archive in windows environment:

            this program it asks for bzip2.dll and two more.

            This is because KArchive can do much more than tar and my pre-compiled version allows you to do that linking to those libraries. They are available in the same link from which you downloaded the KArchive library.
            Linking to those libraries does not mean your tar archive is getting compressed. it just means you have the option to compress it

            ZgemboZ Offline
            ZgemboZ Offline
            Zgembo
            wrote on last edited by
            #26

            @VRonin said in Implement something like tar archive in windows environment:

            @Zgembo said in Implement something like tar archive in windows environment:

            this program it asks for bzip2.dll and two more.

            This is because KArchive can do much more than tar and my pre-compiled version allows you to do that linking to those libraries. They are available in the same link from which you downloaded the KArchive library.
            Linking to those libraries does not mean your tar archive is getting compressed. it just means you have the option to compress it

            Thank you @VRonin . I have managed to create, test and run my test program in qt creator. I have managed to create a tar archive. Now I am trying to figure out how to unpack this archive file from my program.

            VRoninV 1 Reply Last reply
            0
            • ZgemboZ Zgembo

              @VRonin said in Implement something like tar archive in windows environment:

              @Zgembo said in Implement something like tar archive in windows environment:

              this program it asks for bzip2.dll and two more.

              This is because KArchive can do much more than tar and my pre-compiled version allows you to do that linking to those libraries. They are available in the same link from which you downloaded the KArchive library.
              Linking to those libraries does not mean your tar archive is getting compressed. it just means you have the option to compress it

              Thank you @VRonin . I have managed to create, test and run my test program in qt creator. I have managed to create a tar archive. Now I am trying to figure out how to unpack this archive file from my program.

              VRoninV Offline
              VRoninV Offline
              VRonin
              wrote on last edited by
              #27

              @Zgembo said in Implement something like tar archive in windows environment:

              Now I am trying to figure out how to unpack this archive file from my program.

              That library uses the same interface for all "archives" so you can use the unzip example to extract your tar archive just by changing KZip to KTar

              "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
              ~Napoleon Bonaparte

              On a crusade to banish setIndexWidget() from the holy land of Qt

              ZgemboZ 1 Reply Last reply
              2
              • VRoninV VRonin

                @Zgembo said in Implement something like tar archive in windows environment:

                Now I am trying to figure out how to unpack this archive file from my program.

                That library uses the same interface for all "archives" so you can use the unzip example to extract your tar archive just by changing KZip to KTar

                ZgemboZ Offline
                ZgemboZ Offline
                Zgembo
                wrote on last edited by
                #28

                @VRonin said in Implement something like tar archive in windows environment:

                @Zgembo said in Implement something like tar archive in windows environment:

                Now I am trying to figure out how to unpack this archive file from my program.

                That library uses the same interface for all "archives" so you can use the unzip example to extract your tar archive just by changing KZip to KTar

                Thank you. Figured it out already :-)

                1 Reply Last reply
                0
                • ZgemboZ Offline
                  ZgemboZ Offline
                  Zgembo
                  wrote on last edited by
                  #29

                  I have moved my project from Qt Creator to Visual studio. I can compile the project in debug mode, but when I run it I get an error
                  "The application was unable to start correctly (0xc000007b). Click OK to close the application"

                  I have added lib path to Project->Properties->Linker->Additional library directories
                  and I have added all required dll files to Linker->Input section (bzip2.lib, liblzma.lib, zlib.lib, KF5Archive.lib, KF5Archived.lib)

                  I have added include path to Project->Properties->C/C++/General->Additional include directories

                  1 Reply Last reply
                  0
                  • VRoninV Offline
                    VRoninV Offline
                    VRonin
                    wrote on last edited by
                    #30

                    That error usually comes up when you mix 32 and 64 bits version of the libraries.

                    "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                    ~Napoleon Bonaparte

                    On a crusade to banish setIndexWidget() from the holy land of Qt

                    ZgemboZ 1 Reply Last reply
                    2
                    • VRoninV VRonin

                      That error usually comes up when you mix 32 and 64 bits version of the libraries.

                      ZgemboZ Offline
                      ZgemboZ Offline
                      Zgembo
                      wrote on last edited by
                      #31

                      @VRonin Yes you are right. I have copied wrong dll to debug folder, so on runtime my app tried to open these 32-bit dlls.
                      Where is the best way to put these .dlls for production enviroment? Should I copy all these dlls to c:\windows\system32?

                      jsulmJ 1 Reply Last reply
                      0
                      • ZgemboZ Zgembo

                        @VRonin Yes you are right. I have copied wrong dll to debug folder, so on runtime my app tried to open these 32-bit dlls.
                        Where is the best way to put these .dlls for production enviroment? Should I copy all these dlls to c:\windows\system32?

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #32

                        @Zgembo said in Implement something like tar archive in windows environment:

                        Should I copy all these dlls to c:\windows\system32

                        Please not! :-)
                        Just put them in same directory where you have your executable.

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        ZgemboZ 1 Reply Last reply
                        3
                        • jsulmJ jsulm

                          @Zgembo said in Implement something like tar archive in windows environment:

                          Should I copy all these dlls to c:\windows\system32

                          Please not! :-)
                          Just put them in same directory where you have your executable.

                          ZgemboZ Offline
                          ZgemboZ Offline
                          Zgembo
                          wrote on last edited by
                          #33

                          @jsulm OK, thank you. What about my include files? Now I have my KArchive folder that have "include" and "libs" subfolders in my C:\Downloads folder. I have included this two folders with their absolute path into my project (visual studio project).
                          Is there a better way to do this, because this is a large project that have a lot of developers.

                          VRoninV 1 Reply Last reply
                          0
                          • ZgemboZ Zgembo

                            @jsulm OK, thank you. What about my include files? Now I have my KArchive folder that have "include" and "libs" subfolders in my C:\Downloads folder. I have included this two folders with their absolute path into my project (visual studio project).
                            Is there a better way to do this, because this is a large project that have a lot of developers.

                            VRoninV Offline
                            VRoninV Offline
                            VRonin
                            wrote on last edited by
                            #34

                            @Zgembo said in Implement something like tar archive in windows environment:

                            because this is a large project that have a lot of developers.

                            Every project will have its own convention. just ask how you guys handle 3rd party libraries locations

                            "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                            ~Napoleon Bonaparte

                            On a crusade to banish setIndexWidget() from the holy land of Qt

                            1 Reply Last reply
                            0
                            • ZgemboZ Offline
                              ZgemboZ Offline
                              Zgembo
                              wrote on last edited by
                              #35

                              OK, thank you. My test program now works in debug mode. I am having problems compiling program in RELEASE mode. For some reason it can not see qplatformdefs.h . I have double checked that path to that file is included as @VRonin stated in some of the previous posts.

                              1 Reply Last reply
                              0
                              • VRoninV Offline
                                VRoninV Offline
                                VRonin
                                wrote on last edited by
                                #36

                                Visual studio uses different "Additional library directories" and "Additional include directories" for different platforms (x86 and x64) and configurations (Debug/Release) so every time you have to set the same thing multiple times for each of them using the comboboxes in the top part of the properties widow of the project

                                "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                                ~Napoleon Bonaparte

                                On a crusade to banish setIndexWidget() from the holy land of Qt

                                1 Reply Last reply
                                1
                                • ZgemboZ Offline
                                  ZgemboZ Offline
                                  Zgembo
                                  wrote on last edited by
                                  #37

                                  Figured it out. Everything works now. Thank you.

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

                                    IIRC, qmake can generate Visual Studio Solutions that should handle that for you. Worth a try at least.

                                    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
                                    • ZgemboZ Offline
                                      ZgemboZ Offline
                                      Zgembo
                                      wrote on last edited by
                                      #39

                                      I have moved everything to my main project and it works. Now I can tar and untar files form my main project.

                                      Right now I am trying to figure out best way to indicate to a user that archiving or unarchiving process is in progress. I was thinking of using qprogressbar but I do not see a way to send any signal from KArchive function to qprogressbar.
                                      Lets say that I have for example three large files to unarchive (few gigabytes). What would be the best way to somehow indicate to a user what is going on?

                                      mrjjM 1 Reply Last reply
                                      0
                                      • ZgemboZ Zgembo

                                        I have moved everything to my main project and it works. Now I can tar and untar files form my main project.

                                        Right now I am trying to figure out best way to indicate to a user that archiving or unarchiving process is in progress. I was thinking of using qprogressbar but I do not see a way to send any signal from KArchive function to qprogressbar.
                                        Lets say that I have for example three large files to unarchive (few gigabytes). What would be the best way to somehow indicate to a user what is going on?

                                        mrjjM Offline
                                        mrjjM Offline
                                        mrjj
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #40

                                        @Zgembo
                                        In cases where you cannot know the length of the process/get status,
                                        you can use a QLabel with a animated gif.
                                        like
                                        alt text

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

                                          You can use a QProgressBar with both min and max set to 0. This will give you an "infinite" animated bar.

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

                                          ZgemboZ 1 Reply Last reply
                                          1

                                          • Login

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