more on zip files...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • dulux1309
    Indigo Rose Customer
    • Feb 2003
    • 172

    more on zip files...

    Hi again,

    I am using the code from the .zip demo (the one with the three blue buttons offering options for zipping individual files, folders non-recursively and folders recursively) Here is the rub - I am trying to zip a directory that has other sub directories in it. I would like to zip the root and have all the other folders retain their structure. At the moment, it is simply taking all files within the root and placing them in the root of the zip file. How can i get this to zip the folder and retain the folder structure?

    Cheers.
    With our fists clenched,
    We cannot shake hands
  • Ted Sullivan
    Indigo Rose Staff Member
    • Oct 2003
    • 963

    #2
    Make sure you're using 5.0.0.4 and read the new documentation. Unfortunately, the syntax changed just a little bit and you'll need to adjust the sub-folder setttings.
    New Release: Setup Factory 9.6 adds Windows 11 compatibility and support for hardware token OV/EV Code Signing certificates.

    Comment

    • rhosk
      Indigo Rose Customer
      • Aug 2003
      • 1698

      #3


      Regards,

      -Ron

      Music | Video | Pictures

      Comment

      • dulux1309
        Indigo Rose Customer
        • Feb 2003
        • 172

        #4
        getting warmer...

        Thanks all -

        I have read the updated docs and followed the kindly posted link, and now the following is happening -

        my zip file is created a treat, complete with the sub folders, but they are empty. Their contents are still being added to the root of the zip file and not staying within the subfolders!

        below is the code, for clarity.

        --------------------------------------------
        -- Get the user to specify where to create the zip file
        tFiles = Dialog.FileBrowse(false, "Save As", "", "Zip Archives (*.zip)|*.zip|", "", "zip", false, false);
        -- Ensure the user did not press 'cancel'
        if tFiles[1] ~= 'CANCEL' then
        -- copy file path to a string
        sZipFile = tFiles[1];
        -- Get the user to select a folder containing files to add to the zip file
        sLocation = Dialog.FolderBrowse("Directory Location", "Please select a directory containing the files you wish to add:");
        -- Ensure the user did not press 'cancel'
        if sLocation ~= 'CANCEL' then
        -- Show the status dialog
        StatusDlg.Show(0, false);
        -- Find all files in the selected directory (recursive)
        tFiles = File.Find(sLocation, "*.*", true, false, nil);
        -- Hide the status dialog
        StatusDlg.Hide();
        -- Ensure there are files to add
        if tFiles then
        -- Show the status dialog
        StatusDlg.Show(0, false);
        -- Add the found files to the zip file
        Zip.Add(sZipFile, tFiles, true,"", 5, nil, true);
        -- Hide the status dialog
        StatusDlg.Hide();
        end
        end
        end
        -------------------------------------------

        thanks
        With our fists clenched,
        We cannot shake hands

        Comment

        • dulux1309
          Indigo Rose Customer
          • Feb 2003
          • 172

          #5
          still baffled

          I have read the examples and tried everything I can think of to make this work properly - I am still getting everything removed from the subfolders and placed in the root, even though the subfolders themselves are recreated in the .zip.

          The line below seems to be correct, but I am pulling my hair out here - maybe time for a hat. Has anyone else seen this problem?

          ---------------------------------------

          Zip.Add(sZipFile, tFiles, true,"", 5, nil, true);
          With our fists clenched,
          We cannot shake hands

          Comment

          • rhosk
            Indigo Rose Customer
            • Aug 2003
            • 1698

            #6
            I think IR is looking into this (guessing). They gave me an awesome solution via the link I provided, but you're right, it seems that that script "should" work and it doesn't. It needs a bit of clarification when using variables.
            Regards,

            -Ron

            Music | Video | Pictures

            Comment

            • dulux1309
              Indigo Rose Customer
              • Feb 2003
              • 172

              #7
              Thanks for the support - I have a ticket running and the guys at IR have been great so far. I need to respond to them, which I will do tomorrow, and then hopefully things will be a bit clearer...
              With our fists clenched,
              We cannot shake hands

              Comment

              Working...
              X