Get dir looping working on OSX