Welcome to the Xceed Community Sign in | Join | Help
Community Search  

Zipping Empty Subfolders

Sort Posts: Previous Next
  •  04-23-2008, 4:50 PM Post no. 11694

    Zipping Empty Subfolders

    I have an application where the path needs to be preserved.  Often the path will contain an empty subfolder.  When using Winzip, the empty subfolder won't be displayed in the GUI but will be preserved and created once the file is unzipped.  In Xceed using processsubfolders, I can preserve subfolders containg at least one file but empty subfolders are lost.  Is there a way in Xceed to preserve the empty subfolders?
  •  04-24-2008, 3:12 PM Post no. 11715 in reply to 11694

    Re: Zipping Empty Subfolders

    You need to set the ExcludedFileAttributes property to xfaNone. Here is a code example:

    XceedZip zip = new XceedZipLib.XceedZipClass();
    bool licenseResult = zip.License( "License key" );

    Console.WriteLine( licenseResult.ToString() );
    zip.PreservePaths = true;
    zip.ZipFilename = @"D:\Forum11694\archive.zip";
    zip.FilesToProcess = @"D:\TestFolder\*";
    zip.ProcessSubfolders = true;
    zip.ExcludedFileAttributes = xcdFileAttributes.xfaNone;

    xcdError message = zip.Zip();
    Console.WriteLine( message.ToString() + " (" + ( ( int )message ).ToString() + "):" );
    Console.WriteLine( zip.GetErrorDescription( xcdValueType.xvtError, ( int )message ) );


    Charles Bérubé-Rémillard
    Technical Support
    Xceed Software Inc.
  •  04-28-2008, 4:30 PM Post no. 11819 in reply to 11715

    Re: Zipping Empty Subfolders

    For future reference, the xcdFileAttributes.xfaNone alone didn't work correctly.  The resolution was to set it to xcdFileAttributes.xfaVolume (8) because the default value is xfaVolume + xfaFolder.  Thanks to CharlesB with Xceed support.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.