Size: 2902
Comment:
|
Size: 1208
Comment: Warning added
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= SevenZip = {{{SevenZip}}} is part of the CategoryAplTree project. <<TableOfContents>> == Warning == || /!\ Unfortunately a bug in 7-zip was discovered that makes it impossible to make use of it || For details see the [[http://aplwiki.com/SevenZip/ProjectPage | project page ]] |
|
Line 2: | Line 13: |
The class "SevenZip" relies on an installed version of the Open Source zipper [[http://www.7-zip.org/ | 7zip]]. | |
Line 3: | Line 15: |
INI files are still useful to provide settings to an application. Vista is not going to change this. The Windows API methods provided to read a particular value have an advantage: they follow a clearly defined search path, and following that path they take not only the INI file into account, they also check the Windows registry and the command line parameter. Furthermore, they deliver always up-to-date values. |
The class makes it very easy to zip as well as unzip stuff. |
Line 6: | Line 17: |
They have disadvantages as well: | "SevenZip" suppports the following formats: * 7z * split * zip * gzip * bzip2 * tar |
Line 8: | Line 25: |
* They are slow * They return everything as a string |
You can either specify an appropriate extension or set the "type" property in order to enforce a certain format. |
Line 11: | Line 27: |
If you are not interested in the Windows registry and command line parameters, and if you are not changing your INI files while the application is running, then the "!IniFile" class introduced in this article might attract your attention. This class allows you to use a kind of APL-Syntax in your INI files. == Details == An entry like: {{{HomeFolder='C:/Windows/Appl/'}}} results in a string holding the path, but an entry like: {{{FormSize=300 400}}} results in a two-element-vector "!FormSize" holding two integers. Furthermore, an entry like: {{{LogFolder='{"HomeFolder}Logsfiles/'}}} is treated in a special way: the name between the curlies is taken as the name of an alreday defined value. It is then replaced by the value of that entry. After creating an instance from the class: {{{MyIni←⎕New #.IniClass 'C:/Appl/Example.ini'}}} you can get all information you are interested in by calling the only method "Get". Given this file "Example.ini": |
|
Line 39: | Line 28: |
[GENERAL] MaxNoOfErrors=20 FormSize=800 1200 LogfileFlag=1 LogLevels=1 2 3 ; from 1 to 9 [DIR] Home='C:/mainfolder/' AppFolder='{Home}appls/' DocsFolder='{Home}docs/' LogFileFolder='{Home}Logs/' |
myZipper←⎕new #.SevenZip (,⊂'MyZipFile') ⎕←myZipper [SevenZip@MyZipFile] myZipper.Add 'foo.txt' ⎕←myZipper.List 0 foo.txt myZipper.Unzip 'c:\output\' |
Line 52: | Line 37: |
You can get any level of information you are interested in: | == Project Page == |
Line 54: | Line 39: |
* get everything * get only a particular section * get a particular value in a particular section |
For bug reports, future enhancements and a full version history see SevenZip/ProjectPage |
Line 58: | Line 41: |
== Examples == | == Version Information == ||Original author: ||KaiJaeger || ||Responsible: ||KaiJaeger || ||Email: || kai@aplteam.com || |
Line 60: | Line 46: |
{{{ MyIni.Get ⍬ ⍬ GENERAL MAXNOOFERRORS 20 FORMSIZE 800 1200 LOGFILEFLAG 1 LOGLEVELS 1 2 3 DIR HOME C:/mainfolder/ APPFOLDER C:/mainfolder/appls/ DOCSFOLDER C:/mainfolder/docs/ LOGFILEFOLDER C:/mainfolder/Logs/ MyIni.Get'General' ⍬ MAXNOOFERRORS 20 FORMSIZE 800 1200 LOGFILEFLAG 1 LOGLEVELS 1 2 3 MyIni.Get'General' 'FormSize' 800 1200 ¯1 MyIni.Get'General' 'Unknown' ⍝ with default ¯1 MyIni.Get'General' 'Unknown' ⍝ without default Value Error: "Unknown" myDoc.Get'General' 'Unknown' }}} |
<<Include(APLTreeDownloads)>> |
Line 86: | Line 48: |
>> [:IniFiles/Script:The Script] Author: Kai Jaeger |
|
Line 90: | Line 49: |
CategoryDyalog CategoryScripts | CategoryAplTree |
SevenZip
SevenZip is part of the CategoryAplTree project.
Warning
|
For details see the project page
Overview
The class "SevenZip" relies on an installed version of the Open Source zipper 7zip.
The class makes it very easy to zip as well as unzip stuff.
"SevenZip" suppports the following formats:
- 7z
- split
- zip
- gzip
- bzip2
- tar
You can either specify an appropriate extension or set the "type" property in order to enforce a certain format.
myZipper←⎕new #.SevenZip (,⊂'MyZipFile') ⎕←myZipper [SevenZip@MyZipFile] myZipper.Add 'foo.txt' ⎕←myZipper.List 0 foo.txt myZipper.Unzip 'c:\output\'
Project Page
For bug reports, future enhancements and a full version history see SevenZip/ProjectPage
Version Information
Original author: |
|
Responsible: |
|
Email: |