add support for per-directory filter files.
~ in paths was not getting translated properly.