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 )

Compress inFilename to an archive file outFilename. 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 )

Compress file or directory, inFilename, to an archive file, outFilename.

Parameters

outFilename

Name of target archive file.

inFilename

Name of source file or directory to be compressed.

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 © 2021 OpenText Corporation. All rights reserved.