fileDecompressedName (property)

The name of the file in the archive, as stored on the file system, outside the archive.

Syntax

- (NSString*)fileDecompressedName:(int)fileIndex;
- (void)setFileDecompressedName:(int)fileIndex:(NSString*)newFileDecompressedName;
public func fileDecompressedName(fileIndex: Int32) throws -> String
public func setFileDecompressedName(fileIndex: Int32, newFileDecompressedName: String) throws -> Void

Default Value

""

Remarks

The name of the file in the archive, as stored on the file system, outside the archive.

When compressing files, This property should be specified with a path, if necessary, to allow the file to be found by the class. If the file cannot be found during compression, a trappable error will be generated, and the archive will not be correctly written.

When decompressing files, the property indicates where the file should be written. After the archive is scanned, the values of FileCompressedName and DecompressedName will be set to the exact filenames found in the archive. The value of DecompressedName may then be changed if desired.

If DecompressedName is set to an empty string before extraction, the file will not be written to disk at all. It will still be written to the Progress event if WriteToProgressEvent is set to true.

If DecompressedName is set to an empty string before compression, the file will be skipped, and not written to the archive.

A base path for decompression may be specified by setting the ExtractToPath property. If ExtractToPath is set to a non-empty string, the files will be decompressed to the directory specified in ExtractToPath. If the value of FileDecompressedName contains a pathname it will be regarded as relative to ExtractToPath.

Paths on the local file system should be specified in the format native to the host operating system. They may also be specified in standard (UNIX) format, in which case they will be immediately converted.

Example


ZipControl.ArchiveFile = "c:\test.tar"
ZipControl.Scan()
ZipControl.ExtractToPath = "c:\temp\"
ZipControl.Files[1].DecompressedName = "test\temp.out"
ZipControl.Extract(ZipControl.Files[1].CompressedName)
Incorrect Example
ZipControl.ExtractToPath = "c:\temp\"
ZipControl.Files[1].DecompressedName = "c:\temp\test\temp.out"
'The file would be extracted to c:\temp\c:\temp\test\temp.out

The FileIndex parameter specifies the index of the item in the array. The size of the array is controlled by the FileCount property.

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