tomerfiliba / plumbum

Plumbum: Shell Combinators
https://plumbum.readthedocs.io
MIT License
2.79k stars 182 forks source link

recursive globbing not work like pathlib #628

Open yakkle opened 1 year ago

yakkle commented 1 year ago

recursive globbing not work like pathlib. Is this intented?

if cwd is /home/yakkle/tmp has subdirectory foo/bar, and has file sample.zip in foo/bar :

>>> local.cwd // "**/*.zip"
[]
>>> 

will show empty list.

if base path is /home/yakkle/tmp/foo:

>>> local.cwd["foo"] // "**/*.zip"
[<LocalPath /home/yakkle/tmp/foo/bar/sample.zip>]
>>> 

will show found result. but it only 1 depth search. not recursive.


python docs says :

The “**” pattern means “this directory and all subdirectories, recursively”. In other words, it enables recursive globbing:

https://docs.python.org/3.9/library/pathlib.html?highlight=mkdir#pathlib.Path.glob