Compressing a folder creates two zip files

I've got a folder called Blanks/ABC FM/SMS/Other and when I compress it I get two zip files of the same size: one with the correct name and the other called Archive.zip. When I remove the space I only get the Archive.zip. When I remove the slashes I get the correct zip file only.
Is this a bug that I should report? How?

If you were expecting C/D to compress to C/D.zip instead of Archive.zip I think I have an explanation for that.
The unix file system which is the underlying OSX file system uses slash (/) as a path delimiter.  So to use an example like yours, if you create a folder A on the desktop and B within A then that the pathname is A/B.  But in reality, being on your desktop it is /Users/you/A/B, where you is your user id.
The finder tries to allow as many characters as it can for filenames.  But the slash it cannot allow in a filename when recorded in the file system.  So what it does is actually change the slash to a colon in the actual filename.  Thus the filename "A/B" in the finder is, in reality, "A:B" in the file system.
I think this colon-equals-slash naming convention is what causing the finder's Compress to treat the name specially and it just changes it the output to be the generic Archive.zip.
Compress is there as a convenience.  There's lots of other ways to do zips.  There's third party utilities.  There's zip command in the terminal (where you can play the finder's game and generate A:B.zip so that it displays in the finder as A/B.zip).

Similar Messages

  • I have a Probook running 10.7.5 and have compressed the 60Gb MobileSync folder into a zip file that is... 60Gb, the original file is still there so I have just lost another 60Gb of space.  What's going on?

    I have a Probook running 10.7.5 and have compressed the 60Gb MobileSync folder into a zip file that is... 60Gb, the original file is still there so I have just lost another 60Gb of space.  What's going on?

    Habibullah Allah Yar.
    Kabul Afghanistan.
    Head of Green Shaheen Group of Company's.
    Website: www.gsls-c.com.
    <Personal Information Edited by Host>

  • Create a zip files in a special way

    Dear all,
    Following my yesterday's posting, I would clarify my questions:
    I successfully created a zip file which contains a folder structure and two files from strings. See attached codes.
    However, I don't like the way that I physically created subfolder and files before add them to the zip file.
    Is there any possibility to avoid that part of creating multiple folders?
    Regards.
    Pengyou
    package com.zip.test;
    import java.io.BufferedInputStream;
    import java.io.BufferedOutputStream;
    import java.io.BufferedWriter;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    public class ZipTest {
         static final int BUFFER = 2048;
         public static void main(String argv[]) {
              try {
                   BufferedInputStream origin = null;
                   FileOutputStream dest = new FileOutputStream("mytest.zip");
                   ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(
                             dest));
                   // out.setMethod(ZipOutputStream.DEFLATED);
                   byte data[] = new byte[BUFFER];
                   try {
                        String strManyDirectories = "root/dir1/dir2";
                        // Create multiple directories
                        boolean success = (new File(strManyDirectories)).mkdirs();
                        if (success) {
                             System.out.println("Directories: " + strManyDirectories
                                       + " created");
                        File outputFile = new File("root/dir1/dir2/test.html");
                        BufferedWriter bufferedWriter = new BufferedWriter(
                                  new FileWriter(outputFile));
                        bufferedWriter.write("Hello, Test");
                        bufferedWriter.close();
                        File outputFile1 = new File("root/dir1/dir2/test1.html");
                        BufferedWriter bufferedWriter1 = new BufferedWriter(
                                  new FileWriter(outputFile1));
                        bufferedWriter1.write("Hello, Test1");
                        bufferedWriter1.close();
                   } catch (IOException e) {
                   String files[] = { "root/dir1/dir2/test.html",
                             "root/dir1/dir2/test1.html" };
                   for (int i = 0; i < files.length; i++) {
                        System.out.println("Adding: " + files);
                        FileInputStream fi = new FileInputStream(files[i]);
                        origin = new BufferedInputStream(fi, BUFFER);
                        ZipEntry entry = new ZipEntry(files[i]);
                        out.putNextEntry(entry);
                        int count;
                        while ((count = origin.read(data, 0, BUFFER)) != -1) {
                             out.write(data, 0, count);
                        origin.close();
                   out.close();
              } catch (Exception e) {
                   e.printStackTrace();

    pengyou wrote:
    But I did not understand how to convert a String to ZipOutputStream with a user choosen file name and a user choosen folder structure.
    I am blocked at that point. Sorry for repeating the same question.
    That doesn't make sense to me. Even more so as your sample code suggests that you are familiar with Writer and ZipEntry concepts. Can you explain in detail where you are stuck or what part of my previous suggestion was unclear to you?
    Scratch that, I think I finally understand your problem. I think the following sample code will get you on track:import java.util.zip.ZipOutputStream;
    import java.util.zip.ZipEntry;
    import java.io.FileOutputStream;
    import java.io.BufferedWriter;
    import java.io.OutputStreamWriter;
    public class ZipTest {
        public static void main( String[] args ) throws Exception {
            final String[] content = {"bla", "blubber"};
            final String[] names = {"root/content1/c1.txt", "root/content2/c2.txt"};
            final String path = System.getProperty("user.home") + "/test.zip";
            ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(path));
            BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(zos, "UTF-8"));
            for (int i = 0; i < content.length; ++i) {
                final ZipEntry entry = new ZipEntry(names);
    zos.putNextEntry(entry);
    bw.write(content[i]);
    bw.flush();
    zos.closeEntry();
    // this will close zos, too
    bw.close();
    Edited by: thomas.behr on Apr 22, 2009 4:10 PM

  • Creating a zipped file from table data

    I am currently extracting data from a table and creating a flat file which is read later to create a compressed (zip) file.
    Is there a way that I can create a zipped file in one step (i.e. directly from the table data)? I am trying to reduce the number of file i/o hits in my appication.
    Thanks,
    Minesh

    Is there a way that I can create a zipped file in one step (i.e. directly from the table data)?Yes. Instead of doing something like:
    FileOutputStream fout = new FileOutputStream("flatfile");
    // write using foutdo this:
    ZipOutputStream zout = new ZipOutputStream("flatfile.zip");
    zout.putNextEntry(new ZipEntry("flatfile"));
    // write using zout

  • Adding a folder to a zip file

    How can I add a folder to a zip file. What I want is to create a txt file, which I place in a regular folder,  then place the regular folder in a zipped folder. They all (folder, file , and zip) need to be the same name also, so the directory would be as an example C:\Desktop > runner.zip > runner > runner.txt or something similar. So far I can create a zip file, and I can create a regular folder and place the txt document in the regular folder, but i cannot seem to be able to put the regular folder in the zip folder. I get an error saying: "LabVIEW:  An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @." It creates the zip file, and also the other folder with the txt file in it, but it wont put the regular folder in the zip file.
    Thanks ahead of time

    lvuser333 wrote:
    are you using the example file or the same code as the above screen shot? So i think my problem is I have been trying to addd the folder to a zip file I created, whereas I think that if I just zip up the folder that has the txt file in it, I will then have a zip file which contains a folder which contains the txt file, is this correct?
    I'm using the code in the screenshot (I whipped up the example quickly to see if I could get it to work, so it probably isn't the best or cleanest way to do it).
    [The example code from NI should work, but is probably more than you need].
    You zip files, but you tell the VI which folder within the zip file (i.e. relative to the zip file) you want them to go in.
    Just like how you might have a folder tree on your C drive
    animals
    ->mammals
    ---->four_legs
    -------->delicious
    -------->thinks_you_are_delicious
    ---->two_legs
    ->birds
    ---->can_fly
    ---->cannot_fly
    ->fish
    ---->salt_water
    ---->fresh_water
    You can have the same structure in the zip file.
    For instance a photo of a flathead (a type of salt water fish)..
    the file might be flathead.jpg with the path within the zip would be fish\salt_water\flathead.png
    on the other hand a tiger photo
    the file would be tiger.png but the path would be mammals\four_legs\thinks_you_are_delicious\tiger.p​ng

  • Compress KM documents in a ZIP file

    Hi everyone,
    Someone has already developed a program that lets compress KM documents in a ZIP file?
    Thanks & regards
    Hassan

    GaryJSF wrote:
    Hi,
    I have code similar to the one below and it is working but I would like to add a directory to the zip file to do something like:
    test.zip
    Folder1
    file1
    file2
    Folder2
    file3
    Zip files don't use a folder structure per-se, they use slashes to delimit path segments:
    ZipEntry entry = new ZipEntry("Folder1/");
    ZipEntry entry = new ZipEntry("Folder1/file1"); //etcTry it and if you have trouble come back and ask insightful questions.
    Edited by: endasil on 7-Oct-2009 2:11 PM

  • I need to know how to "compress" the Folder Tree.  The File folders are moving to the right and out of sight in Lightroom 5.

    I need to know how to "compress" the Folder Tree.  The File folders are moving to the right and out of sight in Lightroom 5.

    A couple of suggestions that may help:
    - Make sure you've made the left-hand column as wide as possible by grabbing the divider between the column and the Library grid view.
    - You can hide a parent folder from the display by right-clicking it and selecting Hide This Parent. This will shift all the child folders to the left.

  • Problems creating/extracting ZIP files, anyone?

    Greetings,
    I am having some odd bugs with OSX in creating and extracting ZIP files.  I’m curious if anyone else has run across this or if anyone has any remedies to suggest.
    The issue is that when I extract a ZIP archive, the extracted files have their creation dates and modification dates changed from the original versions.  For example, I have a directory created in 2010 and all the files were created and last modified in 2010.  However, when I ZIP the directory and re-extract it, many of the file dates change.  Some files have the creation dates changed so to match the last modified date.  In other cases, both the creation date and modification date are changed to something later than both, perhaps the date the directory was ZIPed or the date the directory was extracted.  And some files don’t seem to have the dates changed. 
    I have tried various options, such as terminal, and third party programs (BetterZip, Keka, Stuffit, & Archiver to name a few) and they all seem to have some variation of this behavior.  I have tried creating the Zip with one program and extracting with the other, and still this behavior persists.  Different files seem to be affected with each combination of creating and extracting programs. 
    Another odd behavior was that I tried password protecting some directories with financial data, and OSX could create the ZIP file with the password, but OSX could not unzip the file with the password it created for some files.  In every case, third party program could unzip the files with the password created in the terminal command.  This seem to happen inconsistently. 
    I have tried creating a dummy account and tested it in that account, with similar results.
    I’ve read the man page for the command line version of ZIP to see if there is some -option to preserve dates, but found nothing.  The typical command looks like this:
    > zip -er filename.zip  sourceDir
    > unzip filename.zip
    File types include directories, PDFs, Text docs, Quicken files.  Ive tested other directories too with other file types.  It doesn’t seem to affect every file, but seems unpredictable.  Luckily, I still have the original uncompressed version of most directories.  But I really want to archive some directories and unarchive them when needed.  The dates matter to me because they are mostly financial files and I use the dates to know what versions were used for taxes and other things.  Also, if dates change, then backup programs start replacing the good backups with files with the corrupted dates. 
    I’d appreciate any suggestions or feedback.  I there some bug in the ZIP protocol?  Is there some bug in OSX file system that is corrupting the dates with the archive and unarchive process? 
    Thank you for any suggestions-
    OSX 10.9.5,
    MBPro 2012

    OK, sorry did not read it correctly.  Read the first sentance and quit.
    No, Bridge is just a browser.  You can extract more than one file at a time in Win. Explorer.  You have to do them individually, but can run multiple extractions at the same time.
    There are other zip/unzip programs out there.  I know the the CS6 beta a number of users could not open it with WinZip and used alternate product just fine.

  • How to create a zip file whith passwprd ?

    Hi Im trying to create a zip file using the java zip support, the zip file is being created correctly now I have one doubt I would like to know if the zip file can be protected with a password as Winzip does, if so could you tell me please how to do it.
    Regards,
    Antonio
    [email protected]

    With Core Java, for all I know you still can't.

  • HELP!EXPORTING FROM KEYNOTE TO QUICKTIME AND IT CREATES TWO DIFFERENT FILES

    I made a presentation in keynote, adding music from my itunes library and need to send it to a client (who owns a PC) ASAP.
    When I export my keynote file to QT, it creates two separate files on my computer. One is the project and one is the "soundtrack.mov"
    1. Why does it create two separate files?
    2. How can I send the ENTIRE presentation in one?
    3. How can I send it to a PC user?
    4. Why did it tell me on my last music selection that I added to keynote (After I exported) that I would have to open it in itunes???
    Totally NEED HELP ASAP!
    Thank you
    ML

    Yeah, me too. Bump. Can anybody explain this behavior?!?

  • Extension for creating a zip file and unzipping it

    Iam totally new to Dreamweaver and the extensions. So please
    help me with this.
    Assuming i have a .zip file and it contains some html pages
    along with css and gifs.
    The req is to have an Import option, which given this zip
    file, can unzip its contents. The user can work on these html
    pages. When the user finishes working on them, I need an export
    button so that we can package the entire stuff back into a zip
    file.
    How can i implement this ?
    Is there any extension that is available for this ?
    Eagerly looking forward to some useful answers...
    Thanks in advance,
    Ganesh

    There used to be one .. I'm not sure if that was in DMX time
    or DMX 2004
    time .. that, when installed, allowed you to select files
    from the site
    folder or the whole thing and create a zip from them. I don't
    remember what
    it was called or who created it .. but it might be on one of
    my archived
    disks or zips .. I'll try to check it out later today.
    Nancy Gill
    Adobe Community Expert
    Author: Dreamweaver 8 e-book for the DMX Zone
    Co-Author: Dreamweaver MX: Instant Troubleshooter (August,
    2003)
    Technical Editor: DMX 2004: The Complete Reference, DMX 2004:
    A Beginner''s
    Guide, Mastering Macromedia Contribute
    Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP
    Web Development
    "Ganesh Ram" <[email protected]> wrote in
    message
    news:engarc$d62$[email protected]..
    > Iam totally new to Dreamweaver and the extensions. So
    please help me with
    > this.
    >
    > Assuming i have a .zip file and it contains some html
    pages along with css
    > and
    > gifs.
    > The req is to have an Import option, which given this
    zip file, can unzip
    > its
    > contents. The user can work on these html pages. When
    the user finishes
    > working on them, I need an export button so that we can
    package the entire
    > stuff back into a zip file.
    >
    > How can i implement this ?
    > Is there any extension that is available for this ?
    >
    > Eagerly looking forward to some useful answers...
    >
    > Thanks in advance,
    > Ganesh
    >
    >

  • Missing folder structure in zip file from Theme Editor

    Hi all gurus!
    I have an interesting problem with this background: I want to change the customer brand image in the portal header and do som other modifications. For this reason I have made a copy of one of the standard portal themes, as I'm supposed to do, and I have downloaded that zip file from the portal.
    When unzip this file i get the following files: its.zip, log.html, metadata.properties, portal.zip and upgrade.xml. As I have understood it that is the correct content. Now I'm supposed to unzip the file "portal.zip" and reach amongst other folders the one named "prtl". In this one there is a folder named "images" and under that one is "header" found and in THAT folder the change of picture is done.
    Now for the problem: when I unzip "portal.zip" I just get the content of some property file, NO folders what so ever! If I try to unzip "its.zip" I can see the folder structure under that folder!
    If I open the structure with Total Commander I can see the missing folders! But I can't do the copying of the image, the whole structre gets duplicated when I save! I thought the zip file was corrupt so I made another copy and downloaded it but with the same result!
    Has anyone had the same problem???
    Best regards
    Benny Lange

    Problem solved! By 7-zip. It was actually XP's integrated zip tool that just didn't show the underlaying structure. And Total Commander also did the work if used in the same way as 7-zip, but to edit the second level zip file directly did not work as TC opened that file in a temp directory instead of continuing at the level of the first zip file. That kind of editing directly in a file two zip levels down actually worked in TC 6.x but now I have 7.05 and perhaps things has changed.

  • How can i create a zip-file with multiple volumes

    Hi,
    i've to zip a large file (250 MB and more). But the zip file shouldn't be greater than 5 MB, because i have to send the file via E-Mail. So i've thought, that the solution of this problem can be to zip the large file in smaller zip-files, which are multiple volumes of a zip-archive. I've searched very long in WWW, but didn't find something. Perhaps you can help.
    Sorry, about the bad english. :-)
    Timo Bunger

    Hi
    Who said your english is bad ?. OK, are you looking for compressing the 250 MB file in to multiple versions using a java program ?. If not, there is a shareware you can download and split the file into multiple parts by specifying size of each part. You can send these parts via email and the other person can combine these parts into a single file again.
    Find this @
    http://www.freedownloadscenter.com/Utilities/File_Splitting_Utilities/EzSplit.html
    You may need to read a bit about it on how to use.
    Thanks
    Srinivas

  • Problem with creating a ZIP file

    I have a program that uses java.util.zip to zip all the files in a user's directory (aproximately 7 files totalling 2 MB). When the files are extracted later using WinZip or a similar tool, the files appear to be the same (same file size & date), but they can not be opened by the program that uses them. When I use a binary diff tool to compare the before zip and after zip files, it shows about 20 random bytes that have changed. Anybody else seen this occur?
    Thanks

    Hi,
    I am successfull in putting all the files of a
    directory in a newly created ZIP file. But if my
    directory has a sub-directory, it's not workin....m
    not able to zip it properly. I mean, my program is
    doin it withour error but when i try to open it using
    WinZip...it's giving me an error sayin as not a proper
    archive...
    Do anyone have faced this problem??
    GauzYou need to call the following functions of ZipOutputStream after completing zipping in your code ?
         objZipOutputStream.finish();
         objZipOutputStream.close();Also for every file being zipped, you should to call
    objZipOutputStream.closeEntry()to close that zipEntry.
    Hope this helps.

  • Creating a zip file from the contents of a directory

    hi, I am having a problem as the title suggests with a zip fil creation...
    using the basic example zip.java i wished to edit it so it doesnt zip a file fro the current directory but rather a directory i inputted.
    It is able to read the first file then throws out the following error with the code below it:
    java.io.FileNotFoundException: test.jpg (The system cannot find the file specified)
    import java.io.*;
    import java.util.zip.*;
    public class Zip {
       static final int BUFFER = 2048;
       public static void main (String argv[]) {
          try
             BufferedInputStream origin = null;
             FileOutputStream dest = new FileOutputStream("C:/Documents and Settings/Phil/My Documents/My Pictures/Work/test.zip");
             CheckedOutputStream checksum = new CheckedOutputStream(dest, new Adler32());
             ZipOutputStream out = new
               ZipOutputStream(new BufferedOutputStream(checksum));
             //out.setMethod(ZipOutputStream.DEFLATED);
             byte data[] = new byte[BUFFER];
             // get a list of files from current directory
             File f = new File("C:/Documents and Settings/Phil/My Documents/My Pictures/Work/");
             f.listFiles();
             String files[] = f.list();
             for (int i=0; i<files.length; i++)
                System.out.println("Adding: "+files);
    FileInputStream fi = new FileInputStream(files[i]);
    origin = new BufferedInputStream(fi, BUFFER);
    ZipEntry entry = new ZipEntry(files[i]);
    out.putNextEntry(entry);
    int count;
    while((count = origin.read(data, 0,
    BUFFER)) != -1)
    out.write(data, 0, count);
    origin.close();
    out.close();
    catch(Exception e)
    e.printStackTrace();
    After investigation i am lead to believe this is because the method returns an array of file and directory names only but not their path and the unqualified names would have therefore be defaulted to the current working directory. Something i understand if this is the case.
    So instead i used the File.listFiles() method to return an array
    of File objects, instead of an array of Strings as shown in the snippet of the changed code below (the changed code highlighted)...but arrived at another error on the second section of highlighted code meaning i cant compile. I cant understand why this is so!
    The error is: "cannot find symbol, Symbol: Contructor ZipEntry (Java.IO.file), location: class.java.util.zip.ZipEntry"
    File f = new File("C:/Documents and Settings/Phil/My Documents/My Pictures/Work/");
             **************File g[] = f.listFiles();***************
             **************String files[] = f.list();**************
             for (int i=0; i<g.length; i++)
                System.out.println("Adding: "+g);
    FileInputStream fi = new FileInputStream(g[i]);
    origin = new BufferedInputStream(fi, BUFFER);
    **************ZipEntry entry = new ZipEntry(g[i]);************
    out.putNextEntry(entry);
    int count;
    while((count = origin.read(data, 0,
    BUFFER)) != -1)
    out.write(data, 0, count);
    origin.close();
    out.close();
    Any help and thoughts most appreciated. Thank u in advance

    I'll admit i took 1 look at that reply an thought "thats stupid that wont work"...
    then a second look an though "actually, i should work i cant believe i didnt think of that"
    Anyways i tried it and it did work
    How are the duke dollars awarded, cos u should have them ordinary_guy
    cheers!

Maybe you are looking for

  • Unable to install Windows 7 Ultimate 64 bit on Lenovo 3000 J115 7387-26U

    Hi Everyone, I am unable to install Windows 7 Ultimate 64 bit on my Lenovo desktop. Model : 3000 J115 7387-26U. When I try to boot my DVD, the systems makes a loud whirring noise.. as if trying to read from DVD, the screen goes blank couple of times

  • How to import multiple folders with subfolders several levels deep

    How do I import several hundred subfolders of a top folder into Aperture. Do I have to sit for days importing every single subfolder one by one? or is there any way to automate this procedure? For export is there any way to macro export muliple folde

  • Crashes on duplicate page

    Indesign CC 2014 crashes whenever I duplicate a page, however I do it. Anybody got the same issue or knows a fix

  • Problems With Downloading Podcasts

    When ever I try to download the podcasts that I subscribe to; I keep getting an error 500 and stops. What exactly is an "Error 500" and how can I fix it?

  • Insert group based on values in array

    Is it possible to do the following: formula 1 currentdate - 9 formula 2 currentdate - 2 create another formula that will store the dates in between formula 1 and formula 2 into an array and then insert a group based on each value in this array? Thank