Added directory support for text files