Dynamically link matching directories and files