2007/12/14, Michael Biebl <[EMAIL PROTECTED]>:
> 2007/12/13, Rainer Gerhards <[EMAIL PROTECTED]>:
> > Lol... the initial message seems not to have passed my spam filter... ;)
> >
> > I, too, tend to option three. The problem, though is
>
> Yeah, it's the most flexible one.
>
> > backwards-compatibility... Any suggestions and concerns are appreciated.
>
> This feature has been pretty new, and as such probably isn't widely used.
> I would simply emphasize this change in the release notes and the Changelog.
> The worst that can happen is, that a file is not included anymore.
>
> >
> > I'll look at the code to see how much work that creates. I think the
> > complexity is quite acceptable. I am right now in a threading redesign,
> > so I'd like to push this away for a little while... Anyhow, please keep
> > comments floating - I'll listen and drop in any thoughts I have.
>
> Should be fairly straightforward to implement using
> http://www.gnu.org/software/libc/manual/html_node/Globbing.html#Globbing
>
Small example using glob:
#include <glob.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char **argv)
{
glob_t files;
int ret = 0;
int i = 0;
char *path;
if (argc > 1) {
path = argv[1];
} else {
path = strdup("/etc/rsyslog.d/*.conf");
}
ret = glob(path, GLOB_ERR, NULL, &files);
printf("All files matching %s:\n", path);
for (i = 0; i < files.gl_pathc; i++) {
printf("\t%s\n", files.gl_pathv[i]);
}
globfree(&files);
printf("Finished\n");
return EXIT_SUCCESS;
}
man 3 glob has more information.
If wanted, I can prepare a patch for rsyslog.
Cheers,
Michael
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog