validate_gzip_file {zlib} | R Documentation |
Validate if a File is a Valid Gzip File
Description
This function takes a file path as input and checks if it's a valid gzip-compressed file.
It reads the file in chunks and tries to decompress it using the zlib library.
If any step fails, the function returns FALSE
. Otherwise, it returns TRUE
.
Usage
validate_gzip_file(file_path)
Arguments
file_path |
A string representing the path of the file to validate. |
Value
A boolean value indicating whether the file is a valid gzip file.
TRUE
if the file is valid, FALSE
otherwise.
Examples
validate_gzip_file("path/to/your/file.gz")
[Package zlib version 1.0.3 Index]