Sending error messages for dir and file.