added more specific error message when opening file for reading or
writing. CHECK: could this be done by simply analyzing the value of "status" return variable?