OScript API/Built-in Package Index

Class: Zip

The Zip package provides services for compressing and decompressing files. The major functionalities offered in the Zip Package are the following:

  • Compress() Compress a file or directory to a archive file.
  • Decompress() Decompress a archive file to a directory.

Class Attributes

Unknown error constant .

File not found error constant.

The input file for Decompress is not a file error constant.

The output archive file for Compress does not have write permission error constant.

Success return constant.

Class Methods

Compress( String outFilename, String inFilename, [Boolean forceZip64] )

Compress inFilename to an archive file outFilename, using Zip32 format if forceZip64 is FALSE, Zip64 otherwise. inFilename can be a valid file or directory

Decompress( String outDirname, String inFilename )

Decompress archive file,inFilename, to directory, outDirname.

Class Attributes

Error ERROR

Unknown error constant.

File not found error constant.

Error NOTAFILE

The input file for Decompress() is not a file error constant.

The output archive file for Compress() does not have write permission error constant .

Integer OK

Success return constant.

Class Methods

Compress

Integer Compress( String outFilename,
                  String inFilename,
                  [Boolean forceZip64] )

Compress file or directory, inFilename, to an archive file, outFilename, using Zip32 format if forceZip64 is FALSE, Zip64 otherwise.

Parameters

outFilename

Name of target archive file.

inFilename

Name of source file or directory to be compressed.

forceZip64

TRUE to compress inFilename using Zip64 format, FALSE for Zip32. The default is TRUE.

Returns:

An Integer indicating the return status. Possible values are:

Result Meaing
OK Compression successful
FILENOTFOUND inFilename does not exist
NOWRITEPERMISSION outFilename does not have write permission
ERROR any other errors

Decompress

Integer Decompress( String outDirname,
                    String inFilename )

Decompress an archive file, inFilename, to directory, outDirname.

Parameters

outDirname

Name of target directory where decompression will occur. If outDirname does not exist then it will be created.

inFilename

Name of source archive file to be decompressed.

Returns:

An Integer indicating the return status. Possible values are:

Result Meaing
OK Decompression was successful
FILENOTFOUND inFilename does not exist
ERROR any other errors

 Copyright © 2022 OpenText Corporation. All rights reserved.