dirent types for netbsd
clean up for touch
start to move code to common util