auto subdir detection