Altered for non OS specific reading of directories