-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support glob matching on strings. #653
Conversation
Makes sense to me |
Looks cool, but is this going to break Windows? |
Oh right, it will. fnmatch is POSIX only. Is it acceptable to throw an error saying glob is not supported on windows, or should I add an equivalent? |
I'd say the most important thing is to make sure sysdig still compiles, you can judge the effort required for adding the portable code, I don't think it's that important. |
Ok, I added a general function that calls fnmatch on unix and PathMatchSpec on windows. I still need to test the windows build but I'll do that tomorrow. |
Committing separate from other changes.
c8f6e03
to
30a3209
Compare
Windows has min()/max() macros that conflict with the functions from numeric_limits::min()/max(), so disable them via #define NOMINMAX.
30a3209
to
73cdebe
Compare
Add new comparison "glob" that allows for glob matching on pathnames. The glob matching is handled by a utils function glob_match that calls fnmatch on windows and PathMatchSpec on windows. This handles simple stuff like *, ?, etc. but not shell specific extensions.
723ad23
to
122afdc
Compare
* Whitespace diffs. Committing separate from other changes. * Fix windows build. Windows has min()/max() macros that conflict with the functions from numeric_limits::min()/max(), so disable them via #define NOMINMAX. * Support glob matching on strings. Add new comparison "glob" that allows for glob matching on pathnames. The glob matching is handled by a utils function glob_match that calls fnmatch on windows and PathMatchSpec on windows. This handles simple stuff like *, ?, etc. but not shell specific extensions.
* Whitespace diffs. Committing separate from other changes. * Fix windows build. Windows has min()/max() macros that conflict with the functions from numeric_limits::min()/max(), so disable them via #define NOMINMAX. * Support glob matching on strings. Add new comparison "glob" that allows for glob matching on pathnames. The glob matching is handled by a utils function glob_match that calls fnmatch on windows and PathMatchSpec on windows. This handles simple stuff like *, ?, etc. but not shell specific extensions.
Add new comparison "glob" that allows for glob matching on pathnames, as
implemented by fnmatch(). This handles simple stuff like *, ?, etc. but
not shell specific extensions.
Sound like a good idea @luca, @ldegio @gianlucaborello?