is_compressed_file: Check if a File is Compressed

View source: R/utils.R

is_compressed_fileR Documentation

Check if a File is Compressed

Description

This function checks whether a given file is compressed by inspecting its magic number (first few bytes). It detects common compression formats such as gzip ('.gz'), bzip2 ('.bz2'), and xz ('.xz').

Usage

is_compressed_file(file_path)

Arguments

file_path

A character string giving the path to the file to be checked.

Value

A character string indicating the compression type ('"gzip (.gz)"', '"bzip2 (.bz2)"', or '"xz (.xz)"') if the file is compressed, or 'FALSE' if the file is not recognized as compressed.


Qploidy documentation built on July 11, 2026, 5:06 p.m.