Skip to contents

This function uses the system's file command to determine the type of the file specified by the Path parameter. It returns a character string describing the file type.

Usage

FileType(Path)

Arguments

Path

A character string specifying the path to the file whose type is to be determined. The path must not be NULL, and the file must exist.

Value

A character string describing the file type.

Note

This function relies on the system's file command and therefore might produce different outputs on different platforms.

Examples

(f <- system.file("ex/elev.tif", package="terra"))
#> [1] "/home/runner/work/_temp/Library/terra/ex/elev.tif"

FileType(Path = f)
#> [1] "TIFF image data, little-endian, direntries=19, height=90, bps=16, compression=LZW, PhotometricInterpretation=BlackIsZero, width=95"