Reverted IO to use string instead of file for directories