Detect directory that application is running into.