Difference between revisions of "FreePascalArchivePackage"

From Lazarus wiki
Jump to navigationJump to search
m (Text replace - "delphi>" to "syntaxhighlight>")
(wikify)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
=== About ===
+
== About ==
 
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.
 
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.
  
=== Status: Alpha ===
+
Status: Alpha, ie it needs testing.
Needs testing.
 
  
=== Author ===
+
This package was created and generously made available to the open source community by [http://sourceforge.net/projects/tpabbrevia/ TurboPower Software].
This package was created and generously made available to the open source community by [http://sourceforge.net/projects/tpabbrevia/ TurboPower Software]
 
  
=== License ===
+
License: [http://www.mozilla.org/MPL/MPL-1.1.html MPL 1.1].
[http://www.mozilla.org/MPL/MPL-1.1.html MPL 1.1]
 
  
=== Download ===
+
== Download ==
 
The latest release of FpArchive can be found on the [http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=98986&release_id=478029 Lazarus CCR Files page].
 
The latest release of FpArchive can be found on the [http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=98986&release_id=478029 Lazarus CCR Files page].
  
=== Change Log ===
+
Outdated: Getting the latest source from CVS. Only svn ("Subversion") is being used by now. CVS is no longer being used.
Version 3.05
 
- Changed the unit name "types" to "typesarchive" to avoid conflict with Lazarus' unit "types";
 
- added {$mode delphi} in abfcifdi.pas for compatability.
 
  
=== Getting the latest source from CVS ===
 
 
  cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/lazarus-ccr login
 
  cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/lazarus-ccr login
 
(press the Enter key when prompted for a password)
 
(press the Enter key when prompted for a password)
 
   
 
   
 
  cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/lazarus-ccr co fparchive
 
  cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/lazarus-ccr co fparchive
 +
 
This package is also available from the Free Pascal Compiler CVS in projects/contrib/abbrevia
 
This package is also available from the Free Pascal Compiler CVS in projects/contrib/abbrevia
  
=== Dependencies / System Requirements ===
+
== Dependencies ==
 
Small amounts of 386 assembler.
 
Small amounts of 386 assembler.
  
=== Installation ===
+
== Usage ==
Un-tar the file
 
 
 
=== Usage ===
 
 
1. For your project open "Project->Compiler Options->Other unit files" and add the path to the FPArchive units
 
1. For your project open "Project->Compiler Options->Other unit files" and add the path to the FPArchive units
  
 
2. In the "uses" clause of your unit add AbBase, AbBrowse, AbZBrows, AbUnzper, AbArcTyp
 
2. In the "uses" clause of your unit add AbBase, AbBrowse, AbZBrows, AbUnzper, AbArcTyp
  
3. Create an unzip object: <syntaxhighlight>UnZip := TAbUnZipper.Create(nil);</syntaxhighlight>
+
3. Create an unzip object: <syntaxhighlight lang=pascal>UnZip := TAbUnZipper.Create(nil);</syntaxhighlight>
  
 
4. Set the directory where you want to extract the files to:  
 
4. Set the directory where you want to extract the files to:  
<syntaxhighlight>UnZip.BaseDirectory := '/path/to/extract';</syntaxhighlight>
+
<syntaxhighlight lang=pascal>UnZip.BaseDirectory := '/path/to/extract';</syntaxhighlight>
  
 
5. To restore directories structure (optional) add this line:
 
5. To restore directories structure (optional) add this line:
<syntaxhighlight>UnZip.ExtractOptions := [eoCreateDirs, eoRestorePath];</syntaxhighlight>
+
<syntaxhighlight lang=pascal>UnZip.ExtractOptions := [eoCreateDirs, eoRestorePath];</syntaxhighlight>
  
 
6. Try to extract all CSV files (for example) from an archive file:  
 
6. Try to extract all CSV files (for example) from an archive file:  
<syntaxhighlight>try
+
<syntaxhighlight lang=pascal>
 +
try
 
   UnZip.FileName := '/file/to/extract.zip';
 
   UnZip.FileName := '/file/to/extract.zip';
 
   UnZip.ExtractFiles('*.csv');
 
   UnZip.ExtractFiles('*.csv');
Line 54: Line 46:
 
     //some error handling
 
     //some error handling
 
   end;
 
   end;
end;</syntaxhighlight>
+
end;
7. Free the created object: <syntaxhighlight>UnZip.Free;</syntaxhighlight>
+
</syntaxhighlight>
 +
7. Free the created object: <syntaxhighlight lang=pascal>UnZip.Free;</syntaxhighlight>
 +
 
 +
== See also ==
 +
* [[paszlib]] is built into FPC/Lazarus. Supports zipping/unzipping .zip files.
  
 
[[Category:Components]]
 
[[Category:Components]]
 +
[[Category:Lazarus-CCR]]

Latest revision as of 23:07, 22 March 2021

About

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.

Status: Alpha, ie it needs testing.

This package was created and generously made available to the open source community by TurboPower Software.

License: MPL 1.1.

Download

The latest release of FpArchive can be found on the Lazarus CCR Files page.

Outdated: Getting the latest source from CVS. Only svn ("Subversion") is being used by now. CVS is no longer being used.

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/lazarus-ccr login

(press the Enter key when prompted for a password)

cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/lazarus-ccr co fparchive

This package is also available from the Free Pascal Compiler CVS in projects/contrib/abbrevia

Dependencies

Small amounts of 386 assembler.

Usage

1. For your project open "Project->Compiler Options->Other unit files" and add the path to the FPArchive units

2. In the "uses" clause of your unit add AbBase, AbBrowse, AbZBrows, AbUnzper, AbArcTyp

3. Create an unzip object:

UnZip := TAbUnZipper.Create(nil);

4. Set the directory where you want to extract the files to:

UnZip.BaseDirectory := '/path/to/extract';

5. To restore directories structure (optional) add this line:

UnZip.ExtractOptions := [eoCreateDirs, eoRestorePath];

6. Try to extract all CSV files (for example) from an archive file:

try
  UnZip.FileName := '/file/to/extract.zip';
  UnZip.ExtractFiles('*.csv');
except
  on E: Exception do
  begin
    //some error handling
  end;
end;

7. Free the created object:

UnZip.Free;

See also

  • paszlib is built into FPC/Lazarus. Supports zipping/unzipping .zip files.