FreePascalArchivePackage: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | ## About | |
| 2 | 2 | ||
| 3 | 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 | 4 | ||
| 5 | 5 | Status: Alpha, ie it needs testing. | |
| 6 | 6 | ||
| 7 | 7 | This package was created and generously made available to the open source community by [TurboPower Software](http://sourceforge.net/projects/tpabbrevia/). | |
| 8 | 8 | ||
| 9 | 9 | License: [MPL 1.1](http://www.mozilla.org/MPL/MPL-1.1.html). | |
| 10 | 10 | ||
| 11 | 11 | ## Download | |
| 12 | 12 | ||
| 13 | 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 | 14 | ||
| 15 | 15 | Outdated: Getting the latest source from CVS. Only svn ("Subversion") is being used by now. CVS is no longer being used. | |
| 16 | 16 | ||
| 17 | - | ||
| 17 | + | ```text | |
| 18 | + | cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/lazarus-ccr login | |
| 19 | + | ``` | |
| 18 | 20 | ||
| 19 | 21 | (press the Enter key when prompted for a password) | |
| 20 | 22 | ||
| 21 | - | ||
| 23 | + | ```text | |
| 24 | + | cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/lazarus-ccr co fparchive | |
| 25 | + | ``` | |
| 22 | 26 | ||
| 23 | 27 | This package is also available from the Free Pascal Compiler CVS in projects/contrib/abbrevia | |
| 24 | 28 | ||
| 25 | 29 | ## Dependencies | |
| 26 | 30 | ||
| 27 | 31 | Small amounts of 386 assembler. | |
| 28 | 32 | ||
| 29 | 33 | ## Usage | |
| 30 | 34 | ||
| 31 | 35 | 1\. For your project open "Project-\>Compiler Options-\>Other unit files" and add the path to the FPArchive units | |
| 32 | 36 | ||
| 33 | 37 | 2\. In the "uses" clause of your unit add AbBase, AbBrowse, AbZBrows, AbUnzper, AbArcTyp | |
| 34 | 38 | ||
| 35 | 39 | 3\. Create an unzip object: | |
| 36 | 40 | ||
| 37 | 41 | ``` pascal | |
| 38 | 42 | UnZip := TAbUnZipper.Create(nil); | |
| 39 | 43 | ``` | |
| 40 | 44 | ||
| 41 | 45 | 4\. Set the directory where you want to extract the files to: | |
| 42 | 46 | ||
| 43 | 47 | ``` pascal | |
| 44 | 48 | UnZip.BaseDirectory := '/path/to/extract'; | |
| 45 | 49 | ``` | |
| 46 | 50 | ||
| 47 | 51 | 5\. To restore directories structure (optional) add this line: | |
| 48 | 52 | ||
| 49 | 53 | ``` pascal | |
| 50 | 54 | UnZip.ExtractOptions := [eoCreateDirs, eoRestorePath]; | |
| 51 | 55 | ``` | |
| 52 | 56 | ||
| 53 | 57 | 6\. Try to extract all CSV files (for example) from an archive file: | |
| 54 | 58 | ||
| 55 | 59 | ``` pascal | |
| 56 | 60 | try | |
| 57 | 61 | UnZip.FileName := '/file/to/extract.zip'; | |
| 58 | 62 | UnZip.ExtractFiles('*.csv'); | |
| 59 | 63 | except | |
| 60 | 64 | on E: Exception do | |
| 61 | 65 | begin | |
| 62 | 66 | //some error handling | |
| 63 | 67 | end; | |
| 64 | 68 | end; | |
| 65 | 69 | ``` | |
| 66 | 70 | ||
| 67 | 71 | 7\. Free the created object: | |
| 68 | 72 | ||
| 69 | 73 | ``` pascal | |
| 70 | 74 | UnZip.Free; | |
| 71 | 75 | ``` | |
| 72 | 76 | ||
| 73 | 77 | ## See also | |
| 74 | 78 | ||
| 75 | 79 | - [[paszlib]] is built into FPC/Lazarus. Supports zipping/unzipping .zip files. | |
| 76 | 80 | ||
| 77 | 81 | --- | |
| 78 | 82 | *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 | 83 | Category: Components | |
| 80 | 84 | Category: Lazarus-CCR |
