getDirectory function

Extract directory path