IPWorks ZIP 2020 Node.js Edition

Questions / Feedback?

Append Method

Adds a file to an existing archive.

Syntax

tar.append(decompressedName, compressedName, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

Append may be used to add a file to an existing archive. Unlike IncludeFiles, Append compresses and adds the file to the archive as soon as it is invoked.

DecompressedName should be set to the name of the single file to be added. It should be specified with a path if necessary, to allow the class to find it. The value of CompressedName is the name that will be stored in the archive.

When Append is invoked, the Scan method will first be invoked, if it has not been invoked already. Note that if IncludeFiles has been invoked, or if the values of FileCompressedName and FileDecompressedName have been set for that file in the Files collection, this information will be reset by the call to Scan.

After the file is added, the array properties will be updated appropriately.

This method may only be used to add a file to an existing archive. To add files to a new archive, the IncludeFiles and Compress methods should be used.

Due to the nature of the gzip format, Append and Delete are not supported for .tar.gz files.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks ZIP 2020 Node.js Edition - Version 20.0 [Build 8300]