Hi,

You could try using a list a files :
vars:
"filelist" slist => {"/a/foo", "/b/foo", "/c/foo"};

classes:
"exists" expression  => fileexists($(filelist));

Regards,
Nicolas

On Fri, Dec 11, 2009 at 11:39 AM, Matthias Teege <matthias-...@mteege.de>wrote:

> Moin,
>
> I can set a class based on the existence of a file with fileexists. But
> sometimes I have to set a class if a file exists in directory "/a" or
> "/b" or "/c". I can use something like this:
>
> "exists_in_a" expression  => fileexists("/a/foo");
> "exists_in_b" expression  => fileexists("/b/foo");
> "exists_in_c" expression  => fileexists("/c/foo");
> "exists" or  => { "exists_in_a","exists_in_b","exists_in_c" };
>
> Is there a more "elegant" way to check for a file?
>
> Many thanks
> Matthias
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine
>
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to