Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Cannot perform the requested operation on Root Folder?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #19682 |

    Hi,

    I’m using a GZip snippet from the samples library C#:

    GZipArchive gzip = new GZipArchive(sourceFile);
    DiskFolder folder = new DiskFolder(targetLocation);
    gzip.CopyTo(folder, true);

    Regardless of the file/folder combination, I get the following error:

    Cannot perform the requested operation on an item that is a root folder.
    Type: Xceed.GZip.GZipArchive
    FullName: \

    Can you point me in the right direction please?

    I can use the Quickzip and normal Zip functions with out isse but this is the first time doing a GZip file.

    Imported from legacy forums. Posted by PaulLeigh (had 2949 views)

    User (Old forums)
    Member
    Post count: 23064

    You cannot use CopyTo() on a Zip or GZip Archive, because the root folder of an archive is “\”, which is not a valid name in Windows, though it is valid inside an archive. Therefore, you must use the CopyFilesTo() method.

    Imported from legacy forums. Posted by André (had 170 views)

    User (Old forums)
    Member
    Post count: 23064

    Doh!

    Cheers.

    Imported from legacy forums. Posted by PaulLeigh (had 3587 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.