is.gzip.file: Check whether a file is gzip-compressed, based on its magic...

View source: R/read_dti_tcktsf.R

is.gzip.fileR Documentation

Check whether a file is gzip-compressed, based on its magic bytes.

Description

Uses the gzip magic number (0x1f 0x8b) rather than the file extension, since files are regularly renamed or stripped of their extension. Reading a gzip-compressed payload from a plain file() connection silently produces garbage.

Usage

is.gzip.file(filepath)

Arguments

filepath

character string, path to the file to check.

Value

logical, TRUE if the file starts with the gzip magic number.


freesurferformats documentation built on Sept. 25, 2026, 1:07 a.m.