Skip to content

Commit

Permalink
handle #81 in hdfs_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
hongooi73 committed Apr 22, 2018
1 parent 70de602 commit 6b29931
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/hdfs_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ hdfs_dir <- function(path=".", ..., full_path=FALSE, include_dirs=FALSE, recursi
else if(dirs_only)
output <- output[substr(output, 1, 1) == "d"]

#output <- gsub("^[^/]*(/.*)$", "\\1", output)
## NOTE: regex below will break on filenames with a space
output <- substr(output, regexpr("[^ ]+$", output), nchar(output))
#output <- substr(output, regexpr("[^ ]+$", output), nchar(output))
output <- sub("^[^ ]+[ ]+[^ ]+[ ]+[^ ]+[ ]+[^ ]+[ ]+[^ ]+[ ]+[^ ]+[ ]+[^ ]+[ ]+", "", output)

if(!full_path && !recursive)
output <- basename(output)
Expand Down

0 comments on commit 6b29931

Please sign in to comment.