improved error message output for file ops and directory ops