(Xojo Plugin) Check if a File is in Gzip Format
This example demonstrates how to use the ExamineFile method to determine whether a file is in Gzip format.
The method inspects the contents of the specified file and returns true if the file is recognized as a valid Gzip file, or false if it is not. This is useful for validating input files before attempting to decompress them.
If the method fails (for example, if the file does not exist or cannot be accessed), the CHECK_SUCCESS macro reports the error.
// This example demonstrates how to determine if a file is in Gzip format.
Dim gzip As New Chilkat.Gzip
// The file to examine:
Dim filePath As String
filePath = "test.gz"
// Check if the file is a valid Gzip file:
Dim isGzip As Boolean
isGzip = gzip.ExamineFile(filePath)
If (isGzip = True) Then
System.DebugLog("The file is a valid Gzip file.")
Else
System.DebugLog("The file isnot a Gzip file.")
End If
|