__MACOSX foldres when zipping a file

Hello,
i often need to make a zip file on my mac and put it on the internet for others to download. when i then open the zipfile i see a __MACOSX folder.
obviously this is for the resource fork and junk like that. this is very confusing for Windows users. So how do i suppress this ?
tyvm

Yes, those directories contain resource fork information and other metadata. I don't know of a way to suppress this if you use the built-in "compress" function in the Finder. However, you can easily create a zip file from the command line using the "zip" command (or tar/gz or bzip2 commands, for that matter), which won't contain this extra data.
Additionally, you could probably also write an Automator workflow that could zip up a folder or a bunch of selected objects without the added stuff.

Similar Messages

  • Java.lang.IndexOutOfBoundsException when zipping larger files

    i get the error:
    java.lang.IndexOutOfBoundsException
    at java.util.zip.ZipOutputStream.write(ZipOutputStream.java:261)
    at compress.zipEntry(compress.java:126)
    at compress.Create_Zip_File(compress.java:84)
    at Test.backup(Test.java:101)
    at Test.<init>(Test.java:37)
    at Test.main(Test.java:149)
    when zipping a file which is 349MB in size I think this might be because it trying to store the file in the memory and the file is too large.What can I do to not store it in memory or if im wrong can someone point me in the right direction.
    Thanks.
    FileOutputStream zipFile = null;
        ZipOutputStream zipOut = null;
       private void listContents( File Zip_File, File dir, ZipOutputStream out )
           throws Exception
           // Assume that dir is a directory.  List
           // its contents, including the contents of
           // subdirectories at all levels.
           System.out.println("Directory \"" + dir.getName() + "\""); 
           String[] files ;  // The names of the files in the directory.
           files = dir.list();
           for (int i = 0; i < files.length; i++) {
           File f;  // One of the files in the directory.
           f = new File(dir, files);
    if ( f.isDirectory() )
    // Call listContents() recursively to
    // list the contents of the directory, f.
    listContents(Zip_File, f, out);
    else
    // For a regular file, just print the name, files[i].
    zipEntry(Zip_File, f, out);
    } // end listContents()
    public void Create_Zip_File(File Zip_File,File[] To_Be_Zipped_Files,
    boolean Skip_Dirs)
    try
    // Open archive file
    FileOutputStream stream=new FileOutputStream(Zip_File);
    ZipOutputStream out=new ZipOutputStream(stream);
    for (int i=0;i<To_Be_Zipped_Files.length;i++)
    //if (To_Be_Zipped_Files[i]==null
    // || !To_Be_Zipped_Files[i].exists()
    // || (Skip_Dirs ))
    // continue;
    System.out.println("Adding "+To_Be_Zipped_Files[i].getName());
    zipEntry(Zip_File, To_Be_Zipped_Files[i], out);
    out.close();
    stream.close();
    System.out.println("Finished zipping : "
    + Zip_File.getAbsolutePath());
    catch (Exception e)
    e.printStackTrace();
    System.out.println("Error: " + e.getMessage());
    return;
    private void zipEntry(File Zip_File, File file, ZipOutputStream out)
    throws Exception
    if (file.isDirectory())
    listContents(Zip_File, file, out);
    return;
    int BUFFER_SIZE=10240000; // 10 M
    byte buffer[]=new byte[BUFFER_SIZE];
    // Add archive entry
    ZipEntry zipAdd=new ZipEntry(file.getAbsolutePath());
    //zipAdd.setTime(file.lastModified());
    out.putNextEntry(zipAdd);
    // Read input & write to output
    FileInputStream in=
    new FileInputStream(file.getAbsolutePath());
    int len;
    int nRead=in.available();
    while((count = in.read(buffer, 0, BUFFER_SIZE)) != -1)
    out.write(buffer, 0, nRead);
    // System.out.println("loop ");
    in.close();
    out.closeEntry();

    of course!!Thanks problem solved:DI don't see how - it is very very wrong!
        private void zipEntry(File Zip_File, File file, ZipOutputStream out)
        throws Exception
            if (file.isDirectory())
                listContents(Zip_File, file, out);
                return;
            int BUFFER_SIZE=4094;
            byte buffer[]=new byte[BUFFER_SIZE];
            // Add archive entry
            ZipEntry zipAdd=new ZipEntry(file.getAbsolutePath());
            //zipAdd.setTime(file.lastModified());
            out.putNextEntry(zipAdd);
            // Read input & write to output
            InputStream in= new BufferedInputStream( new FileInputStream(file.getAbsolutePath()), BUFFER_SIZE);            
            for(int count = 0; (count = in.read(buffer)) != -1;)
                out.write(buffer, 0, count);
            in.close();
            out.closeEntry();     
        }Message was edited by:
    sabre150

  • Wrong path when zip a file

    When I try to Zip a file(backup.zip) everything is good except one thing.
    When I use WinZip to unzip the file, the path for the file contains all subdirectories eg. c:\mycatalog\backup\db\data.data
    I would like the path to be like: backup\db\data.data
    The code:
    pathName is "c:\mycatalog"
    fileName is "backup"
    public class Zip {
    private static ZipOutputStream zos;
    * Creates a Zip archive. If the name of the file passed in is a
    * directory, the directory's contents will be made into a Zip file.
    public static void makeZip(File pathName, String fileName)
    throws IOException, FileNotFoundException
    File file = new File(pathName,fileName);
    zos = new ZipOutputStream(new FileOutputStream(pathName.toString()+"\\"+fileName+".lum"));
    //Call recursion.
    recurseFiles(file);
    //We are done adding entries to the zip archive,
    //so close the Zip output stream.
    zos.close();
    * Recurses down a directory and its subdirectories to look for
    * files to add to the Zip. If the current file being looked at
    * is not a directory, the method adds it to the Zip file.
    private static void recurseFiles(File file)
    throws IOException, FileNotFoundException
    if (file.isDirectory()) {
    //Create an array with all of the files and subdirectories
    //of the current directory.
    String[] fileNames = file.list();
    if (fileNames != null) {
    //Recursively add each array entry to make sure that we get
    //subdirectories as well as normal files in the directory.
    for (int i=0; i<fileNames.length; i++) {
    recurseFiles(new File(file, fileNames));
    //Otherwise, a file so add it as an entry to the Zip file.
    else {
    byte[] buf = new byte[1024];
    int len;
    //Create a new Zip entry with the file's name.
    ZipEntry zipEntry = new ZipEntry(file.toString());
    //Create a buffered input stream out of the file
    //we're trying to add into the Zip archive.
    FileInputStream fin = new FileInputStream(file);
    BufferedInputStream in = new BufferedInputStream(fin);
    zos.putNextEntry(zipEntry);
    //Read bytes from the file and write into the Zip archive.
    while ((len = in.read(buf)) >= 0) {
    zos.write(buf, 0, len);
    //Close the input stream.
    in.close();
    //Close this entry in the Zip stream.
    zos.closeEntry();

    Sorry, I want the path to be like: "\db\data.data"

  • File not found Exception when zipping a file

    Hello I seem to have run into a problem when trying to zip a directory.
    I get the error:
    java.io.FileNotFoundException: C:\Users\dojo\Documents\Programming\compress (Access is denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:70)
    at ZipUtility.zip(ZipUtility.java:31)
    at ZipUtility.main(ZipUtility.java:21)
    when i run the code
    import java.io.File;
    import java.io.FileOutputStream;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    import java.io.*;
    public class ZipUtility {
         public ZipOutputStream cpZipOutputStream = null;
         public String strSource = "";          
         public String strTarget = "";          
         public static long  size          = 0;     
         public static int   numOfFiles    = 0;          
         public static void main(String args[]) {
              ZipUtility udZipUtility = new ZipUtility();                    
              udZipUtility.strSource = "C:\\Users\\dojo\\Documents\\Programming\\compress\\restoreDump"; //args[0];          
              udZipUtility.strTarget = "C:\\Users\\dojo\\Documents\\Programming\\compress"; //args[1];          
              udZipUtility.zip();          
         public void zip(){                    
              try          {                              
                   File cpFile = new File (strSource);                                             
                   if (!cpFile.isFile() && !cpFile.isDirectory() ) {                                   
                        System.out.println("\nSource file/directory Not Found!");                                   
                        return;                         
                   FileOutputStream fos = new FileOutputStream(strTarget);               
                   cpZipOutputStream = new ZipOutputStream(fos);                         
                   cpZipOutputStream.setLevel(9);                         
                   zipFiles( cpFile);                         
                   cpZipOutputStream.finish();                         
                   cpZipOutputStream.close();                         
                   System.out.println("\n Finished creating zip file " + strTarget + " from source " + strSource);                         
                   System.out.println("\n Total of  " + numOfFiles +" files are Zipped " );               
                   System.out.println("\n Total of  " + size  + " bytes are Zipped  ");          
              }     catch (Exception e){                                   
                   e.printStackTrace();                    
         public void  zipFiles(File cpFile) {                    
              int byteCount;
              final int DATA_BLOCK_SIZE = 2048;     
              FileInputStream cpFileInputStream;
              if (cpFile.isDirectory()) {                              
                   if(cpFile.getName().equalsIgnoreCase(".metadata")){ //if directory name is .metadata, skip it.                         
                        return;               
                   File [] fList = cpFile.listFiles() ;                              
                   for (int i=0; i< fList.length; i++){                                        
                        zipFiles(fList) ;                              
              else {                              
                   try {          
                        if(cpFile.getAbsolutePath().equalsIgnoreCase(strTarget)){
                             return;
                        System.out.println("Zipping "+cpFile);                    
                        size += cpFile.length();                    
                        //String strAbsPath = cpFile.getAbsolutePath();                                        
                        numOfFiles++;                    
                        String strAbsPath = cpFile.getPath();                    
                        String strZipEntryName = strAbsPath.substring(strSource.length()+1, strAbsPath.length());                                        
                        //byte[] b = new byte[ (int)(cpFile.length()) ];
                        cpFileInputStream = new FileInputStream (cpFile) ;                                                                           
                        ZipEntry cpZipEntry = new ZipEntry(strZipEntryName);
                        cpZipOutputStream.putNextEntry(cpZipEntry );
                        byte[] b = new byte[DATA_BLOCK_SIZE];
                        while ( (byteCount = cpFileInputStream.read(b, 0, DATA_BLOCK_SIZE)) != -1)
                             cpZipOutputStream.write(b, 0, byteCount);
                        //cpZipOutputStream.write(b, 0, (int)cpFile.length());
                        cpZipOutputStream.closeEntry() ;
                   } catch (Exception e) {                                        
                        e.printStackTrace();                              
    I really have no idea why its saying access denied if anyone can help that would be great.

    son_goku
    Read the stack trace from the bottom up. It's telling you that the error, or exception arose
    at ZipUtility.zip(ZipUtility.java:21)
    which is udZipUtility.zip();This line called the zip() method which threw an exception
    at ZipUtility.main(ZipUtility.java:31)
    which is FileOutputStream fos = new FileOutputStream(strTarget);What is the value of strTarget?"C:\\Users\\dojo\\Documents\\Programming\\compress"This is a folder, isn't it?
    Read the javadoc for public FileOutputStream(String name)
           throws FileNotFoundException
    If the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason then a FileNotFoundException is thrown.
    Regards, Darryl

  • [svn:bz-trunk] 21260: Update the qa-frameworks. zip to remove all comments from the base xml when merging config files.

    Revision: 21260
    Revision: 21260
    Author:   [email protected]
    Date:     2011-05-16 07:46:54 -0700 (Mon, 16 May 2011)
    Log Message:
    Update the qa-frameworks.zip to remove all comments from the base xml when merging config files.
    Modified Paths:
        blazeds/trunk/qa/resources/frameworks/qa-frameworks.zip

    Try options=('!makeflags') in PKGBUILD.

  • When i take file classes12.zip

    Hi all,
    When I take file classes12.zip?
    I need that file for database connection URL?
    Can you give me link for download this file?
    Thanks,
    Best Regards
    Okik Setianto

    Welcome to the forum!
    >
    When I take file classes12.zip?
    I need that file for database connection URL?
    Can you give me link for download this file?
    >
    Here is the official FAQ site with all the jars.
    And it has the link to the main download page
    http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html
    And that page has the link for Oracle 8i files which include classes12.
    http://www.oracle.com/technetwork/database/enterprise-edition/jdbc817-100207.html
    Why do you need such an ancient file?

  • Help with util.zip up files... does not work

    I am writing a program so my mum can zip up new photos she takes and then send them to me. The program creates a html file for the webpage plus a smaller version of her original photo and places them all in a 1 folder with a new name. Al this part works... I want to afterwards place my files in a zipped up folder that she can e-mail me with her normal client. How... I picked up this code on the net and have changed it to incoporate my parameters. The files which are created ..paths are (String in an String[]) I then send to my zipping method.
    The zip file is created but does not work when I try to extract from it ??? I also know that the String [] works becuse I have made a loop to check its properties at each index.
    what am I doing wrong?
    This is a modified code I found on the internet but with no author??
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.util.zip.ZipEntry;
    import java.util.zip.*;
    public class Test{
        private File zipDir;
        private String[] filename;
        public Test(String[] recivedFilename){
            filename = recivedFilename;
            try {
                ZipOutputStream zos = new
                        ZipOutputStream(new FileOutputStream("c:\\curDir.zip"));
                from,
                zipDir("c:\\batviapictures\\", zos);
                zos.close();
            } catch(Exception e) {
                //handle exception
        public void zipDir(String dir2zip, ZipOutputStream zos) {
            try {File
                zipDir = new File(dir2zip);
                String[] dirList = filename;
                byte[] readBuffer = new byte[2156];
                int bytesIn = 0;
                //loop through dirList, and zip the files
                for(int i=0; i<dirList.length; i++) {
                    File f = new File(zipDir, dirList);
    if(f.isDirectory()) {
    String filePath = f.getPath();
    zipDir(filePath, zos);
    continue;
    FileInputStream fis = new FileInputStream(f);
    ZipEntry anEntry = new ZipEntry(f.getPath());
    zos.putNextEntry(anEntry);
    while((bytesIn = fis.read(readBuffer)) != -1) {
    zos.write(readBuffer, 0, bytesIn);
    fis.close();
    catch(Exception e) {

    I make no guarantees that this will completely solve all your problems, but I just know these calls are needed but missing from your OP:
    try {
        ZipOutputStream zos = new
                        ZipOutputStream(new FileOutputStream("c:\\curDir.zip"));
                        from,
                        zipDir("c:\\batviapictures\\", zos);
        zos.flush(); // ADD THIS after all files have been written to the zos
        zos.close();
    } catch(Exception e) {
        //handle exception
    }And
    while((bytesIn = fis.read(readBuffer)) != -1) {
        zos.write(readBuffer, 0, bytesIn);
    zos.closeEntry(); // ADD THIS after each file is written to the zos
    fis.close();

  • Is it possible to zip a file and send it as an attachment in a mail?

    Hi,
    Is it possible to zip a file and send it as an attachment in a mail?

    When you use OWA in something other than IE, you're using OWA lite and no--it is not possible to do either in OWA lite (well, new Exchange stuff makes my answer a little less emphatic but still: pretty much no). Thanks Microsoft. But this guy made it possible to mark unread/read and select all/none:
    http://david-burger.blogspot.com/2008/07/firefox-greasemonkey-outlook-web-access_19.html

  • Error message when compiling book "file is corrupt" referring to a photo.  Or "cannot find original photo".  Can you use photos that have been "edited" out of "Book Mode"?

    Error message when compiling book "file is corrupt" referring to a photo.  Or "cannot find original photo".  Can you use photos that have been "edited" out of "Book Mode"?

    I did copy it to my desktop, but it still won't let me open it.  I think the file on the disc might be corrupt or something like that though the cd itself checks out fine as far as viruses go.  I was able to verify the disc, but that's about it.  My husband tried it on his iMac and we have the same issue.  It's unzipping the folder, but won't let us open the folder on both the Mac Book Pro or the iMac by double clicking, going to file/open or right clicking.  It just keeps saying the same message as I posted above.  I think I'm just going to have the client put the pictures on either a memory card or a USB memory stick so she won't have to compress the files for zipping purposes.  It's been too frustrating trying to open this folder on this cd she gave me.  She said she created/zipped the cd on her Mac Book Pro but it sure won't open on mine.

  • Itunes Crashes when importing Music File or Folder on Windows 7 64-Bit with Itune 10.5 and update ios 5

    Itunes crashes when importing Music File or Folder ever since i updated it yesterday

    You can try downloading 7-Zip (free), or a free trial of WinRAR, and unpack the iTunesSetup.exe or iTunesSetup64.exe file into its components then try installing them individually in alphabetical order (don't try to install SetupAdmin.exe or iCloud.msi). You may get a more useful error message as to which component has problems.
    tt2

  • Getting error when downloading indesign files...(resource_not_found)

    Still getting error ({"message":{"resource_not_found":["https://EU.creative.adobe.com","https://AP.creative.adobe.com"]}}) when my team sends me an indesign file to download. Is there a work around for now?

    Have them zip the file to prevent the email system from messing with it.

  • How to zip a file?

    Hi folks...
    I need to zip a file from Oracle Forms 6i (Oracle EBS 11.5.2.10) or a PL/SQL object to send it by e-mail.
    I did a search and the only solution that I found was using Java:
    *1) Create a java file like:*
    import java.util.zip.*;
    import java.io.*;
    public class zipfile
    public boolean addFile(String filename,String outFilename)
    try {
    int len;
    ZipOutputStream out = new ZipOutputStream(new FileOutputStream(outFilename));
    FileInputStream in = new FileInputStream(filename);
    // Add ZIP entry to output stream.
    out.putNextEntry(new ZipEntry(filename));
    byte[] buf = new byte[1024];
    while ((len = in.read(buf)) > 0)
    out.write(buf, 0, len);
    in.close();
    out.closeEntry();
    out.close();
    return true;
    } catch (IOException e)
    return false;
    *2) Compile this file and import it at Oracle forms using Import Java Classes. But when I try to import this file I get the following error:*
    Importing Class Zipfile...
    Exception occurred: java.lang.UnsupportedClassVersionError: Zipfile (Unsupported major.minor version 50.0)
    What can be? Other Ideas to zip a file using Forms or PL/SQL?
    tks

    This might work, but you have to compile it with an older version of the java-compiler than you do. You might try JDeveloper 9.x which comes with the developersuite10g, but it might also be that you have to use an even older version.

  • Zip the file

    Hi
    Oracle 10g , Sunsolaris 5.9
    I am generating csv file using utl_file option and i need to zip that file using plsql
    I try to use this plsql to do this , but it will not zip the file i compile the procdeure but when i run it didnt
    do any thing , where i did a mistake
    procedure filezip as
    --DECLARE
    src_file BFILE;
    v_content BLOB;
    v_blob_len INTEGER;
    v_file UTL_FILE.file_type;
    v_buffer RAW(32767);
    v_amount BINARY_INTEGER := 32767;
    v_pos INTEGER := 1;
    v_blob BLOB;
    BEGIN
    src_file := BFILENAME('*****','test1.txt');
    DBMS_LOB.fileopen(src_file, dbms_lob.file_readonly);
    v_content := utl_compress.lz_compress('src_file');
    v_blob_len := DBMS_LOB.getlength(v_content);
    v_file := UTL_FILE.fopen('EXPORT_DIR','test1.zip','w');
    WHILE v_pos < v_blob_len
    LOOP
    DBMS_LOB.READ(v_content, v_amount, v_pos, v_buffer);
    UTL_FILE.put_raw(v_file, v_buffer, TRUE);
    v_pos := v_pos + v_amount;
    END LOOP;
    UTL_FILE.fclose(v_file);
    EXCEPTION
    WHEN OTHERS THEN
    IF UTL_FILE.is_open(v_file) THEN
    UTL_FILE.fclose(v_file);
    END IF;
    RAISE;
    END;
    rds

    Generaly you need use Java as Procedure. Read this: [http://asktom.oracle.com/pls/asktom/f?p=100:11:0::NO::P11_QUESTION_ID:952229840241]

  • Open zip/rar files in mail

    Hello,
    I am using the Mail app on my iphone 4s and my ipad3. When someone send me a zip file and I click on it nothing happens.... I can't open it through the email app or download it and open it through another app (I have iZip app....)
    Why is that and what can I do to be able to download and open zip/rar files.
    Thanks,
    YoYo

    Mail attachment support.
    Viewable Document Types
    .jpg, .tiff, .gif (images); .doc and .docx (Microsoft Word); .htm and .html (web pages); .key (Keynote); .numbers (Numbers); .pages (Pages); .pdf (Preview and Adobe Acrobat); .ppt and .pptx (Microsoft PowerPoint); .txt (text); .rtf (rich text format); .vcf (contact information); .xls and .xlsx (Microsoft Excel)
    For Zip attachments.
    http://smallbusiness.chron.com/open-zip-files-iphone-54962.html
    WinZip is reported to support rar files as well.

  • Downloaded my harry potter audiobooks in zipped mp3 files. Trying to unzip them one book at a time to put into itunes to put onto my iphone 6

    I downloaded my harry potter audiobooks in zipped mp3 files. Trying to unzip them one book at a time to  put into iTunes for windows  to put onto my iphone 6+.

    mbstevens1152 wrote:
    Sorry, I should have been more complete in my question. I have done the steps you have listed, the files are not showing up in my iTunes anywhere. I'm obviously doing something wrong, but I cannot figure out what it is. Everything I find online seems to be for older systems then Windows 8.1. I was hoping that might be my problem. Any additional insight or suggestions is appreciated.
    MB,
    After you do the unzip operation, can you see the MP3s on your computer?  What happens when you right-click the MP3 and choose Open With > iTunes?

Maybe you are looking for

  • 3D Reviewer - Configs Not Displayed in PDF

    Hi, I've been trialling the 3D Reviewer replacement for 3D Toolkit. Imported my CAD data (I-Deas Assembly) and then created 3 configurations showing closed, open & exploded positions. I Like the accuracy of the new move/rotate tool - good stuff. Howe

  • After Effects error: crash occurred while invoking effect plug-in "Looks" URGENT!

    My name is Tyler and i'm a Mult-Media Editor in training. Just recently meaning just this project i've been getting this error "After Effects error: crash occurred while invoking effect plug-in "Looks"." every time i try to render. If i try to remove

  • Mapping Adobe Font lib fonts to Opentype fonts

    I have a customer that has been using Font Folio on a MacOS 9. Now they are converting to PC and want to use opentype instead. They have bought the library package for Opentype. Is there anywhere a listing of mappings of fontnames from the old librar

  • Photoshop CS6 problem opening video files

    I have the trial for Photoshop CS6 and the other day I was opening video files to make gifs from perfectly fine, however, now when I try to open video files a box opens saying "Reading Video Format" and then it gets stuck and frozen. I left it for an

  • BT Infinity Speeds slowed to a crawl

    Hi, Just noticed it this evening, but my Broadband speeds (Infinity) has slowed down to <1MBPs. Previously it was >20MBPs. Any reasons why? THanks, -monkey-