snippet to get directory full path