Skip to content

Commit

Permalink
add pattern to match file.name in case of dir yet containing files
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Nov 14, 2013
1 parent 30f7eb8 commit 1810937
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/FigisGeoUtils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 1810937

Please sign in to comment.