Open dvyukov opened 3 months ago
I think it's actually missing feature in filepath.glob, while https://github.com/yargevad/filepathx support it A small filepath extension library that supports double star globbling.
Another point is, I normally use glob for subdir under sysfs for specific kernel subsystem nodes. Perhaps /sys/**/*
is too big nodes to walk.
Yes, pulling all 100K entries in /sys/ looks like too much. And there will probably be more dangerous ones that we will need to filter out.
**
. If we want to support it, we will need to write custom C++ code, which is painful.So I am thinking we don't support **
now (was never supported anyway), but instead list some /sys subdir explicitly.
Another point is, I normally use glob for subdir under sysfs for specific kernel subsystem nodes.
Which subdirs do you use with glob?
Yeah, I noted #4905, I think it's fine to remove glob support now. I can try to access these nodes one by one right now until there is a better solution in future.
With #4905 glob will continue to work as it is now (except that matched directories will be filters out).
We have this syscall:
I guess the intention was that
"**"
does recursive dir search, but"**"
does not work as recursive pattern forfilepath.Glob
(nor POSIXglob
). I have 97948 files in /sys in total, but only 618 matched by"/sys/**/*"
pattern.Another problem is that
filepath.Glob
returns directories as well, and I suspect opening sysfs directories is generally not very useful. Out of 618 entries matched by"/sys/**/*"
, only 30 are normal files (not dirs).So it seems we both don't open lots of useful things, and open lots of unuseful things.
cc @jiangenj