pyfilesystem2 icon indicating copy to clipboard operation
pyfilesystem2 copied to clipboard

fs.glob pattern my_folder/**/* not working as expected

Open LutzFassl opened this issue 2 years ago • 0 comments

Hello, I was under the impression I can use fs.glob mostly like the standard glob library. However I wonder if it is intended that the pattern folder/**/* behaves differently between them.

Standard glob: glob.glob("my_folder/**/*", recursive=True) --> ** means same folder or any folder level below --> Finds all files in my_folder and below. Folders are excluded, which is desired in my case.

fs.glob: fs.glob("my_folder/**/*") seems to behave differently: does not find any files that are directly within my_folder. Finds only files that are at least one level below my_folder.

So the best thing for me would probably to run with fs.glob("my_folder/**") and then filter out the directories afterwards... ?

LutzFassl avatar May 16 '23 14:05 LutzFassl