Topic: Addfile: Change source and destination dir+filename?

Hello!

Is it possible to change the source and destination dir+filename when creating a zip?

Somewhat like that:

zwObject.OpenZip("testfile.zip", False) )
zwObject.AddFile("Source\station.txt", "ZipDir\stationzip.txt, password)
zwObject.CloseZip()

Thanks.
Grisu

Re: Addfile: Change source and destination dir+filename?

greetings smile  that is a great idea and i will get that added.  in the meantime you can use the AddStream method instead:

zwObject.OpenZip("testfile.zip", False) )
Local fileStream:TStream = OpenFile( "Source\station.txt" )
zwObject.AddStream(fileStream, "ZipDir\stationzip.txt, password)
zwObject.CloseZip()

Re: Addfile: Change source and destination dir+filename?

Thanks for your fast answer.
Will check that out.

Are there any disadvantages using streams over a "normal" file creation?
The stream should be faster, but use more memory?

Re: Addfile: Change source and destination dir+filename?

memory-wise not really any disadvantages.  the method addfile essentially does exactly that underneath.  you do lose the datetime stamp of the file though.