From 1810937ded1514d89a0bd5757d073c9a13035399 Mon Sep 17 00:00:00 2001 From: eblondel Date: Thu, 14 Nov 2013 19:12:28 +0100 Subject: [PATCH] add pattern to match file.name in case of dir yet containing files --- R/FigisGeoUtils.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/FigisGeoUtils.R b/R/FigisGeoUtils.R index 91cf2df..a070ab8 100644 --- a/R/FigisGeoUtils.R +++ b/R/FigisGeoUtils.R @@ -89,7 +89,7 @@ exportFeatures <- function(features, outputFormat = "SHAPE-ZIP", file.path = NUL if(outputFormat == "SHAPE-ZIP"){ writeOGR(features, file.path, file.name, driver="ESRI Shapefile") zip_path<-paste(file.path,"/",file.name,".zip",sep="") - shapefiles <- list.files(file.path, full.names=TRUE) + shapefiles <- list.files(file.path, pattern = file.name, full.names=TRUE) zip(zipfile=zip_path, flags="-r9Xj", files=shapefiles) # requires R_ZIPCMD to be set in linux OS. if (! file.exists(zip_path)) {