Sign in Join
Wiki copytemporary

FreePascalArchivePackage: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: FreePascalArchivePackage

OldNewLine
1+## About
2+
3+This is a conversion of TurboPower Software's Abbrevia library for the Free Pascal Compiler. Abbrevia is a compression toolkit that supports PKZIP 4, Microsoft CAB, TAR, & gzip formats. The package contains visual components that simplify the manipulation of ZIP files.
4+
5+Status: Alpha, ie it needs testing.
6+
7+This package was created and generously made available to the open source community by [TurboPower Software](http://sourceforge.net/projects/tpabbrevia/).
8+
9+License: [MPL 1.1](http://www.mozilla.org/MPL/MPL-1.1.html).
10+
11+## Download
12+
13+The latest release of FpArchive can be found on the [Lazarus CCR Files page](http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=98986&release_id=478029).
14+
15+Outdated: Getting the latest source from CVS. Only svn ("Subversion") is being used by now. CVS is no longer being used.
16+
17+`cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/lazarus-ccr login`
18+
19+(press the Enter key when prompted for a password)
20+
21+`cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/lazarus-ccr co fparchive`
22+
23+This package is also available from the Free Pascal Compiler CVS in projects/contrib/abbrevia
24+
25+## Dependencies
26+
27+Small amounts of 386 assembler.
28+
29+## Usage
30+
31+1\. For your project open "Project-\>Compiler Options-\>Other unit files" and add the path to the FPArchive units
32+
33+2\. In the "uses" clause of your unit add AbBase, AbBrowse, AbZBrows, AbUnzper, AbArcTyp
34+
35+3\. Create an unzip object:
36+
37+``` pascal
38+UnZip := TAbUnZipper.Create(nil);
39+```
40+
41+4\. Set the directory where you want to extract the files to:
42+
43+``` pascal
44+UnZip.BaseDirectory := '/path/to/extract';
45+```
46+
47+5\. To restore directories structure (optional) add this line:
48+
49+``` pascal
50+UnZip.ExtractOptions := [eoCreateDirs, eoRestorePath];
51+```
52+
53+6\. Try to extract all CSV files (for example) from an archive file:
54+
55+``` pascal
56+try
57+ UnZip.FileName := '/file/to/extract.zip';
58+ UnZip.ExtractFiles('*.csv');
59+except
60+ on E: Exception do
61+ begin
62+ //some error handling
63+ end;
64+end;
65+```
66+
67+7\. Free the created object:
68+
69+``` pascal
70+UnZip.Free;
71+```
72+
73+## See also
74+
75+- [[paszlib]] is built into FPC/Lazarus. Supports zipping/unzipping .zip files.
76+
77+---
78+*From the Free Pascal wiki, page "FreePascalArchivePackage", as it stood on 2021-03-22 after a change by Alextpp, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
79+Category: Components
80+Category: Lazarus-CCR

Back to history