PetscErrorCode PetscTestFile(const char fname[], char mode, PetscBool *flg)
Notes: if mode is '\0', no permissions checks are performed