Using Zip in Delphi XE5, examples anywhere?

For years I have used an external dll for zipping data files together
into a single zipfile. The authors of the zip32.pas file and the
associated dll are Theo Bebekis and Marcus Wirth and in the file there
is mention of Info-Zip. The sources I use are from January 2000....

Anyway, since I am now converting the old application from Delphi7 to
XE5 I would like to use the built-in zip functionality, but I have
trouble finding any examples on how to use System.Zip...

Can someone here point me towards a working example which packs files
into a zip WITHOUT also stuffing in the original path to that file?
This "path feature" of the Zip32 I use now is really annoying and I
want to get rid of both that and the need to distribute a dll just for
zipping.


---
Bo Berglund
Sweden & Texas
Newsreader: Forte Free Agent 1.92/32.572
0
Bo
4/29/2015 9:29:26 PM
embarcadero.delphi.ide 3925 articles. 0 followers. Follow

2 Replies
1461 Views

Similar Articles

[PageSpeed] 53

> {quote:title=Bo Berglund wrote:}{quote}
> For years I have used an external dll for zipping data files together
> into a single zipfile. The authors of the zip32.pas file and the
> associated dll are Theo Bebekis and Marcus Wirth and in the file there
> is mention of Info-Zip. The sources I use are from January 2000....
> 
> Anyway, since I am now converting the old application from Delphi7 to
> XE5 I would like to use the built-in zip functionality, but I have
> trouble finding any examples on how to use System.Zip...
> 
> Can someone here point me towards a working example which packs files
> into a zip WITHOUT also stuffing in the original path to that file?
> This "path feature" of the Zip32 I use now is really annoying and I
> want to get rid of both that and the need to distribute a dll just for
> zipping.
> 
> 
> ---
> Bo Berglund
> Sweden & Texas
> Newsreader: Forte Free Agent 1.92/32.572

{code}
  with TZipFile.Create do
     try
        open( _ZipName, zmWrite );   //http://docwiki.embarcadero.com/Libraries/XE5/en/System.Zip.TZipFile.Open
        add( _pathandfilenametoadd, _filenameinzip );   //http://docwiki.embarcadero.com/Libraries/XE5/en/System.Zip.TZipFile.Add
        close;
     finally
       free;
     end  
{code}


--
Linden
"Mango" was Cool but "Wasabi" was Hotter but remember it's all in the "source"
0
Linden
4/29/2015 10:27:55 PM
On Wed, 29 Apr 2015 15:27:55 -0700, Linden ROTH <> wrote:

>> Can someone here point me towards a working example which packs files
>> into a zip WITHOUT also stuffing in the original path to that file?
>> This "path feature" of the Zip32 I use now is really annoying and I
>> want to get rid of both that and the need to distribute a dll just for
>> zipping.
>> 
>
>{code}
>  with TZipFile.Create do
>     try
>        open( _ZipName, zmWrite );   //http://docwiki.embarcadero.com/Libraries/XE5/en/System.Zip.TZipFile.Open
>        add( _pathandfilenametoadd, _filenameinzip );   //http://docwiki.embarcadero.com/Libraries/XE5/en/System.Zip.TZipFile.Add
>        close;
>     finally
>       free;
>     end  
>{code}

Thanks, that worked just fine! :)
The second argument of the Add method fixed my problem regarding the
original path being stuffed into the zip.


---
Bo Berglund
Sweden & Texas
Newsreader: Forte Free Agent 1.92/32.572
0
Bo
4/30/2015 11:16:28 PM
Reply:

Similar Artilces:

Is it posible to configure Delphi XE3 IDE to use Delphi 7 compiler/debuger
Hi! Like many other developer out there I have several project which has been developed with older version of Delphi (Delphi 7). Since theese projects rely on some components which are not compatible with newer versions of Delphi (no newer versions available) I'm forced to do any maintnance on theese projects using Delphi 7. Another solution would be to find replacment components which would provide me with same capabilities and work with latest versions of Delphi. But this would probbably require compleete rewritings of my projects (lots and lots of work). So currently I'm using...

SEPA components for Delphi with Source Code (Delphi 5
Hi all, in the european union change next year the Bankingformat to the SEPA Format. All peoples and companies must change the bankingssoftware and the costumer data form acountnummers in the new IBAN and BIC numbers. See: http://www.arma-it.de/shop/artikelueber.php?wgruppeid=211&wgruppe_offen=211 Functions: - generate SEPA XML'S - Calc IBAN - BIC Database (DE,AT and CH) Questions: vertrieb@arma-it.de PS: Bankinssoftware for Develpoers (Germany only) http://www.arma-it.de/shop/artikelueber.php?wgruppeid=212&wgruppe_offen=212 El 26/10/13 21:38, A...

Delphi Paradox to Delphi SQL Anywhere
I need to convert a Delphi 3 app from Paradox tables to something more flexible/powerful. My app creates a limited number of complex transactions ( i.e. 200 to 300 transactions per month - each transaction has 300 to 400 fields in the primary file and links to about a dozen support files. What programming issues should I watch for in this conversion ( i.e. is using quicken style incremental search combo boxes a problem due to network traffic, etc. ) ??? What would be the conversion steps/Issues involved with this process ??? Obviously tables/relationships need to be created a...

Using Delphi 7 and Delphi 2010
I had a project in Delphi 7. I worked on it in Delphi 2010. When I try to open the .dpr again in Delphi 7, the IDE toolbar widens across both monitors, and Delphi 7 locks up. It appears that Delphi 2010 modifies the .dpr in a way that makes Delphi 7 unable to open it again. All my forms & units appear to open fine in D7 after D2010, except for the warnings on the ExplicitHeight and ExplicitWidth properties being missing... I can easily recreate the .dpr, but is this expected behavior? Thanks. Tom Field wrote: > I had a project in Delphi 7. > > I worked o...

Converting from Delphi 2005 to Delphi XE5
I have developed a number of Windows applications in Delphi 2005. I recently purchased Delphi XE5. I have started by trying to compile an existing 2005 application. I am getting a 7 errors about FMXTeeEditor. [dcc32 Error] E1026 File not found: 'FMXTee.Editor.Brush.fmx' Not able to find a solution to this. Any help greatly appreciated. Did you open every form before compiling? The old forms get updated with new properties when they are opened. I would make a copy of the old project before doing any of this. maybe you have links to the older tchart files....i.e its not usi...

delphi Win32 using delphi .NET dll
Hi, I'm trying to use a delphi.NET dll in delphi.WIN32. I am currently using CodeGear Delphi 2007 with version2(base version) of .NET I can get the dll to import into the WIN32 application the only problem is when i include things such as: "using Classes,DateUtils, SysUtils" in the .NET dll the win32 application will instantly hang when any of the dll functions are called. Any help would be great thanks. Also I have tried this example and it also crashes for me? http://cc.embarcadero.com/Item/22688 -Braden I also found this.. "The problem is that, wehn you instal...

Installing Delphi 7 and Delphi XE5 on same machine
Is there any implication installing Delphi 7 and XE5 on a same machine? Will it affect the 3rd party components, libraries, dll etc.? On 15/12/2013 23:56, Ebizit IT wrote: > Is there any implication installing Delphi 7 and XE5 on a same machine? Will it affect the 3rd party components, libraries, dll etc.? Ebizit, The usual guideline is to install in release order, Delphi 7 first, then XE5. I would also advise installing in a dedicated, security open directory such as: C:\Tools\Delphi-7 C:\Tools\Delphi-XE5 However, since I cannot afford the grossly inflated pric...

To use or not to use Delphi
Sadly, it seems to me that there is a sort of race between the two threads, for and against using Delphi in new projects, with more or less the same users posting in both threads. Arguments are fiercely debated in both camps. Borland had their own vision. As a community, now that Delphi has changed ownership I believe we should try to be more consistent, more clear, and more articulate in what we expect from Embercadero in terms of Delphi. We can contribute to keeping Delphi alive and moving in the right direction. "Laurent Cocea" schrieb: > Sadly, it seems to me that there ...

Delphi 2010 and Delphi XE5 shuts down when opening projects
Over the last week I have found it increasingly difficult to open projects. Even really simple projects, some more complex. For example if start Delphi 2010 Enterprise Edition. I see the list of recently opened projects. I then click on a simple existing project, I get a hour glass for about a second and then Delphi IDE has gone. In the windows task manager, there are now no applications running. I have not changed the installation, being using Delphi 2010 enterprise on the same computer for a few years. I'm not a full time developer, but do internal development of our compa...

Delphi 2010 and Delphi XE5 shuts down when opening projects
Over the last week I have found it increasingly difficult to open projects. Even really simple projects, some more complex. For example if start Delphi 2010 Enterprise Edition. I see the list of recently opened projects. I then click on a simple existing project, I get a hour glass for about a second and then Delphi IDE has gone. In the windows task manager, there are now no applications running. I have not changed the installation, being using Delphi 2010 enterprise on the same computer for a few years. I'm not a full time developer, but do internal development of our compa...

can i use delphi 2007 bpls in delphi 2009
can i use delphi 2007 bpls in delphi 2009 ? "Gaetan SIRY" skrev i meddelelsen news:8703@forums.codegear.com... > can i use delphi 2007 bpls in delphi 2009 ? No. -- Finn Tolderlund The compatiblity between D2006 and D2007 was unique. Normaly they can't be compatible because new version enhance/change the API. And D2009 defines String = Unicode where older version has String = Ansistring so D200x/Dx-BPL are 200% incompatible with D2009. ...

How to use a delphi XE3 obj file in delphi 2007?
Hi, I'm migrating an application from delphi 2007 to delphi XE3 and I would like to do it in several steps. To do this I need to use a part of my new code (XE3) in the current delphi 2007 application. So I want to use the .obj file from my XE3 file. I know I have to use the {$L 'Filename'} and I know that I have to declare the functions that I want to use in external in my D2007 project. I wanted to make an easy and simple example to see how it works with only 1 function 'hello world' compiled in obj with XE3 but I can't find the way to use it in D2007. In D200...

Delphi and Delphi for .Net
It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. I would like to know is it true all .Net application is slower than Win32 native applicaiton or it is Delphi for .Net only. Your information is great appreciated, Inung On 2011-06-21 18:20:17 +0100, Inung Huang said: > It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. > I would like to know is it true all .Net application is slower than > Win32 native applicaiton or it is Delphi for .Net only. If you are only running the code in the application once then, yes, yo...

Delphi XE5
Hi, Just installed XE5. There is no setup_paserver.zip file. Where do I get it? Joe > {quote:title=Joe Sansalone wrote:}{quote} > Hi, > > Just installed XE5. There is no setup_paserver.zip file. > > Where do I get it? > > Joe Just realized that its the .pkg file. ...

Web resources about - Using Zip in Delphi XE5, examples anywhere? - embarcadero.delphi.ide

‘Can You Answer Me?!’ Matthews Confronts National Review Editor Over Trump Attacks
Chris Matthews got particularly heated with a National Review editor tonight over the anti-Trump manifesto , contending that the only reason ...

Watch New England Patriots Vs. Denver Broncos Live Online: Free Streaming, AFC Championship Game
The New England Patriots face the Denver Broncos in the AFC Championship game Sunday, and fans can watch the game streaming live online legally ...

Academy’s Historic Changes Elicit Everything From Praise To Outrage To Making Some Members Very Nervous ...
Well, the Academy Of Motion Picture Arts & Sciences has never been accused of moving too swiftly on making sweeping changes, but they clearly ...

This is what the East Coast blizzard looks like from space
Satellites in space are keeping an eye on a huge storm bearing down on the eastern United States. A newly released NASA video shows the storm ...

European authorities angered by VW's North American compensation program
Filed under: Government/Legal , Volkswagen , Diesel Volkswagen is under attack by European legislators after refusing to expand its US compensation ...

What Apple’s latest VR hire means for this growing market
ANALYSIS: Apple invented the smartphone (even though it didn’t). It also invented the tablet … or maybe not. Now, it looks like it might invent ...

'Here's to Flint!' Flint's water disaster began with applause
Los Angeles Times 'Here's to Flint!' Flint's water disaster began with applause Los Angeles Times Pastor David Bullock holds up a bottle of ...

1 Dead, 11 Hospitalized After Listeria Outbreak Linked to Packaged Salad, CDC Says
USA TODAY 1 Dead, 11 Hospitalized After Listeria Outbreak Linked to Packaged Salad, CDC Says ABC News The CDC is investigating a multi-state ...

Skype to hide IP addresses by default, protecting gamers everywhere
Microsoft has rolled out a new version of the desktop Skype client that should make users of its service a little safer from denial-of-service ...

Editorial Cartoons: Stock market, China and oil prices
In this slideshow, we illustrate through cartoons the struggles on Wall Street the past few weeks and the main culprits are actually taking place ...

Resources last updated: 1/23/2016 1:53:58 AM