Adding a safety check for post build directory scanning. Safely handling directories that are too long.