Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Compress – PB Docs 2018 – PowerBuilder Library

Compress – PB Docs 2018

Compress

PowerScript function

Description

Compresses the folder or one or more files, or the byte data
stream.

Applies to

CompressorObject objects

Syntax

Argument

Description

objectname

The name of the CompressorObject
object.

source

A string whose value is the full directory of the
folder or one or more files that will be
compressed.

Or a blob whose value is the byte data
that will be compressed.

dest

A string whose value is the target directory where
the compressed file or folder will be located.

Or a
blob value specifying the target compressed stream.

format (optional)

A value of the enumerated datatype ArchiveFormat
specifying the the format of the target file. The supported values
are:

  • ArchiveFormatZIP! — zip file. Supports AES-256
    encryption for password. This is the default value.

  • ArchiveFormat7Zip! — 7zip file. Supports AES-256
    encryption for password.

  • ArchiveFormatGZip! — gzip format archive. Supports
    compressing a single file.

  • ArchiveFormatTAR! — tar format archive.

If the extension in “dest” is inconsistent
with the format specified in “format”, the file or folder will be
compressed according to the format specified in “format” and the
extension of “dest” will not be revised.

Return value

Integer.

Returns the following value. If any argument’s value is null, the
method returns null.

1 — Success

-1 — A general error occurred. If the CompressorObject object is
used in asynchronous mode, this function will return the general
error.

-2 — The password entered is illegal.

-3 — The operation is not supported for the source file
format.

-4 — The task thread is aborted.

-5 — A task thread is currently running.

-6 — The folder to be compressed does not exist.

-7 — The folder to be compressed is empty.

-8 — The compression format does not support multi-file
compression.

-9 — Failed to read file from the folder for compression.

-10 — The target path does not exist.

-11 — The compressed file cannot be saved to the directory where a
file of the same name already exists.

-12 — Failed to compress.

Example 1

This example demonstrates how to compress a folder.

Example 2

This example demonstrates how to compress a single file.

Example 3

This example demonstrates how to compress multiple files.

Example 4

This example demonstrates how to compress the data stream.

See also

Cancel


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x