Create a zip file



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 05/08/2008 at 09:22, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   10.5 
    Platform:      
    Language(s) :     C++  ;

    ---------
    Hi!

    I've a small problem with the ZipFile-class.

    First try: Open a file and extract it in a directory.

    ZipFile *myzip = ZipFile::Alloc();
                        
                        if(myzip->Open(Filename(tmp), TRUE, FALSE))
                             if(!myzip->ExtractToDirectory(Filename(download_name.GetString(i, "corrupt") + ".zip"), GeGetPluginPath() + Filename("/tmp/"), TRUE))
                                  MessageDialog("Could not extract");

    The MessageDialog is shown.. does anyone know why?

    Second try: Create a zip file and put in some files, but what method is responsible to save this zip? I can't find it...

    Thanks :)



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 07/08/2008 at 07:23, xxxxxxxx wrote:

    Hi!

    Thats very strange.. I found a thread with the same problem (version 9.5).

    Does anyone of you work with the ZipFile Class?

    Bye...



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 07/08/2008 at 09:10, xxxxxxxx wrote:

    Hi!

    It works. Sometimes the principle of try and error is not the worst one..



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/08/2008 at 04:26, xxxxxxxx wrote:

    Would you mind sharing how it finally worked? If this is a common problem it would be helpful for the next one.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/08/2008 at 07:32, xxxxxxxx wrote:

    Hi!

    Sure I share the result :) I don't know if this is really correct, but it works, so it should be correct.

    At first I open the zip file and browse through the zip file.

    > <code>
    > ZipFile *myzip = ZipFile::Alloc();
    >
    > if(myzip->Open(tmp, TRUE, FALSE))
    > {
    >      myzip->GoToFirstFile();
    >      do
    >      {
    >           if(!myzip->ExtractCurrentFile(Filename(<destination>), TRUE))
    >                MessageDialog("Could not extract the file");
    >
    >      }while(myzip->GoTonextFile());
    > }
    > else
    >      GePrint("Cannot open zip file...");
    >
    > myzip->Close();
    >
    > ZipFile::Free(myzip);
    > </code>



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 09/08/2008 at 06:16, xxxxxxxx wrote:

    thx


Log in to reply