From 02bb302c7c188f433b7a12863e2309dafc480a69 Mon Sep 17 00:00:00 2001 From: Jonathan Bob Date: Mon, 20 Oct 2025 12:36:01 +0200 Subject: [PATCH] fix for empty s3 object return --- DESCRIPTION | 2 +- R/listFiles.R | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 54f6ca0..ee26f86 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: rsync Type: Package Title: API to use rsync -Version: 25.10.0 +Version: 25.10.1 Author: INWT Statistics GmbH Authors@R: c(person("Sebastian", "Warnholz", email = "sebastian.warnholz@inwt-statistics.de", role = c("aut", "cre")), person("Jonathan", "Bob", email = "jonathan.bob@inwt-statistics.de", role = c("aut")), diff --git a/R/listFiles.R b/R/listFiles.R index 93ba396..f3d50b7 100644 --- a/R/listFiles.R +++ b/R/listFiles.R @@ -13,7 +13,7 @@ listFiles.default <- function(db, ...) { args <- getArgs(db) dir <- rsynccli(NULL, to, args = args, pre = pre, intern = TRUE) - dir <- dat::extract(dir, ~ !grepl("\\.$", .)) + dir <- dat::extract(dir, ~!grepl("(0\\s$)|(\\.$)", .)) if (length(dir) == 0) { return(emptyDir()) } @@ -63,7 +63,7 @@ listFiles.awss3 <- function(db, recursive = FALSE, ...) { } args <- if (recursive) "ls --recursive" else "ls" dir <- awscli(NULL, dest, args = args, profile = profile, endpoint_url = endpoint_url, intern = TRUE) - dir <- dat::extract(dir, ~ !grepl("\\.$", .)) + dir <- dat::extract(dir, ~!grepl("(0\\s$)|(\\.$)", .)) if (length(dir) == 0) { return(emptyDir()) }