From 6132e0490808b36532113a8197b32b2897eeb442 Mon Sep 17 00:00:00 2001 From: Eduardo Leoni Date: Wed, 26 Feb 2025 08:03:07 -0300 Subject: [PATCH] Reads compressed files Use gzfile instead of file. gzfile opens compressed and uncompressed files. Downloading from Strava in bulk, sometimes the file comes as a gz compressed file. --- R/reader.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/reader.R b/R/reader.R index 6db2487..e82451b 100644 --- a/R/reader.R +++ b/R/reader.R @@ -21,7 +21,7 @@ readFitFile <- function(fileName) { #' @importFrom methods is new .readFile <- function(fileName, preallocate = TRUE) { - con <- file(fileName, "rb") + con <- gzfile(fileName, "rb") on.exit(close(con)) file_header <- .readFileHeader(con)