add file e directory types
cleanup
fix output if write option is choosen