Adding a safety check for post build directory scanning.

Safely handling directories that are too long to process in the post build executable.  Wrapped the code in a try/catch, but open to handling the error some other way.