Scan Method

Scans the compressed archive.

Syntax

ANSI (Cross Platform)
int Scan();

Unicode (Windows)
INT Scan();
- (void)scan;
#define MID_TAR_SCAN 11

IPWORKSZIP_EXTERNAL int IPWORKSZIP_CALL IPWorksZip_Tar_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

This method will scan the archive specified by ArchiveFile. The number of files and their names and sizes will be determined and written to the Files collection.

After scanning the archive, the values of FileDecompressedName may be changed if desired, and any number of files may be decompressed. The Extract method allows you to decompress files of your choice, and the ExtractAll method will decompress the entire archive.

Changing the values of the FileCompressedName field or the number of files in the Files collection will invalidate the scan. If either of these is changed and Extract or ExtractAll is then called; Scan will automatically be called again, and these values will be reset to their original values.

Calling this method will frequently generate a trappable error if the archive is corrupt. This is not guaranteed, however, as Scan only examines the headers.

Example


Dim i As Integer
ZipControl.ArchiveFile = "c:\temp.zip"
ZipControl.Scan
For i = 0 To ZipControl.FileCount - 1
    Debug.Print "File Name: " & ZipControl.FileDecompressedName(i)
    Debug.Print "File Size: " & ZipControl.FileDecompressedSize(i)
Next i

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

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