scandir() calls itself properly.

scandir() will now call itself properly when going down recursively.
rules file is also converted to absolute path by scandir().