fs icon indicating copy to clipboard operation
fs copied to clipboard

dir_ls() glob does not work with subfolders

Open PursuitOfDataScience opened this issue 3 years ago • 1 comments

Hi,

I am on Windows using dir_ls() to walk through all my csv files across various subfolders in a main folder.

For example, the base directory for the following example is C:\\Users\\mainfolder\\, and I use the * to represent all subfolders. There is a report folder in every subfolder storing all csv files. (Note: the path I set here is the absolute one.) dir_ls("C:\\Users\\mainfolder\\", glob = "*\\report\\*.csv", recurse = T)

It seems like glob does not take two *s. Any solutions for this issue? Thanks!

PursuitOfDataScience avatar Jan 19 '22 20:01 PursuitOfDataScience

You can try to use dir_walk() as a workaround.

For the issue, can you try to create a reproducible example? E.g. create a couple of directories with dir.create() and then show that dir_ls() does not work as expected? Thanks!

gaborcsardi avatar Mar 03 '22 17:03 gaborcsardi