Tar Configuration

The component accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

Tar Configuration Settings

CheckForFileLocks:   If true, the component requests an exclusive lock during initialization.

If set to true, the component will request an exclusive lock during initialization to ensure there are no other processes locking a file. This is a temporary lock and is released before work is done. This is especially useful when another process has a partial lock on a file, for instance when Outlook is working with a .pst.

False by default.

CloseStreamAfterCompress:   If true, the component will close the output stream after compression.

This property is true by default. Therefore, by default, the output stream will be closed after compression is completed. In order to keep streams open after the compression completes, you must set this config to false.

CompressionLevel:   The level of compression to use when Gzip compression is enabled.

This property specifies the level of compression to be used, between 1 and 6. Higher values will cause the component to compress better; lower values will cause the component to compress faster.

The default value is 4.

Encoding:   Encoding to be used for filenames.

The encoding to be used for filenames, and for Zip files, the password. The file contents are treated as binary data, and so encoding does not apply to the contents. At present only supported for Zip and Jar.

Default - Zip: "" (use default encoding of current machine, if possible)

Default - Jar: "UTF-8"

Example - This would set encoding to Japanese Shift-JIS.

Zip1.Config("Encoding=SJIS");

ExcludedAttributes:   Attributes of files to be excluded.

Files with attributes matching those specified will be excluded from compression or decompression. May be set to any combination of H (hidden), S (system), A (archive), and R (read-only). (Example: "HSR") Alternatively, may be set to a bitmask of the following flags: Readonly (1), Hidden (2), System (4), Directory (16), Archive (32).

For Java, when compressing, attributes other than "H" and "R" will be ignored (due to JRE limitations).

Default: "" (no excluded attributes)

ExtractFilesOnly:   Whether to only extract the files contained within the archive.

If true, only the files contained within the ArchiveFile are extracted directly to the specified ExtractToPath. Folders contained within the ArchiveFile will not be created within the ExtractToPath. If an archive contains files with the same name, you can control whether or not they get overwritten by setting OverwriteFiles.

ExtraNullBytes:   Extra null bytes to append to the end of the file.

If ExtraNullBytes is set to a nonzero value, the component will write the specified number of null bytes whenever it creates a tar file or appends to an existing one. Setting this property to 1024 (or higher) may be necessary to prevent compatibility problems with certain versions of untar.

OverwriteReadonlyFiles:   Whether to overwrite readonly files.

If true, the component will overwrite readonly files when decompressing. If false (the default), the component will fire the Error event, instead, and will fail with an exception if the error is not trapped and explicitly ignored in the event.

PreserveModifiedTime:   Whether or not to preserve the original modified time on extracted files.

Specifies whether or not the modified time of the extracted files use the current time or the original time of the file in the archive.

When set to True (default) the extracted files will have the same modified time as the original file.

When set to False the modified time on the extracted files will be set to the current time.

SetFilePermissions:   Whether to set UNIX file permissions.

In Java, if the SetFilePermissions configuration setting is set to true, the component will shell out an instance of chmod for each file, and will attempt to set the file permissions to those specified in the Permissions field of the Files collection. This functionality is operating system dependent and will fail in Windows in particular; it may also fail in other operating systems for a variety of reasons.

By default, the component will write all output files with default permissions.

SymlinkAction:   That action to take when a symlink is encountered.

This setting specifies the action to take when a symlink is encountered during decompression. The component does not support symlinks and will fire the Error event. This setting indicates whether the symlink is ignored, or treated as an error. Possible values are:

0 (Ignore - default) The Error event fires and the Ignore parameter is True.
1 The component throws an exception.

This only applies when decompressing.

TempPath:   The location where temporary files are created.

When an archive uses GZip compression temporary files will be created when calling Scan or Extract. This setting specifies the location of the temporary files. If this setting is unspecified the system temp directory will be used.

WriteToProgressEvent:   Whether or not to write data to the Progress Event.

If WriteToProgressEvent is set to true, then all data produced through invocations of Extract, ExtractAll, and Compress will be written to the Progress event as well as to disk. Applications may stream out the compressed or decompressed data by trapping this event and copying the data.

If WriteToProgressEvent is set to false, the data will not be streamed out, and the Data parameter of the Progress event will contain null.

By default, this config is set to false.

Base Configuration Settings

BuildInfo:   Information about the product's build.

When queried, this setting will return a string containing information about the product's build.

GUIAvailable:   Tells the component whether or not a message loop is available for processing events.

In a GUI-based application, long-running blocking operations may cause the application to stop responding to input until the operation returns. The component will attempt to discover whether or not the application has a message loop and, if one is discovered, it will process events in that message loop during any such blocking operation.

In some non-GUI applications an invalid message loop may be discovered that will result in errant behavior. In these cases, setting GUIAvailable to false will ensure that the component does not attempt to process external events.

LicenseInfo:   Information about the current license.

When queried, this setting will return a string containing information about the license this instance of a component is using. It will return the following information:

  • Product: The product the license is for.
  • Product Key: The key the license was generated from.
  • License Source: Where the license was found (e.g. RuntimeLicense, License File).
  • License Type: The type of license installed (e.g. Royalty Free, Single Server).
UseInternalSecurityAPI:   Tells the component whether or not to use the system security libraries or an internal implementation.

By default the component will use the system security libraries to perform cryptographic functions. When set to False calls to unmanaged code will be made. In certain environments this is not desirable. To use a completely managed security implementation set this setting to True. Setting this to True tells the component to use the internal implementation instead of using the system's security API.

Note: This setting is static. The value set is applicable to all components used in the application.

When this value is set the product's system DLL is no longer required as a reference, as all unmanaged code is stored in that file.

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