:orphan: # PetscTestFile checks for the existence of a file ## Synopsis ``` PetscErrorCode PetscTestFile(const char fname[], char mode, PetscBool *flg) ``` Not Collective ## Input Parameters - ***fname -*** the filename - ***mode -*** either 'r', 'w', 'x' or '\0' ## Output Parameter - ***flg -*** the file exists and satisfies the mode ## Note If mode is '\0', no permissions checks are performed ## See Also `PetscTestDirectory()`, `PetscLs()` ## Level intermediate ## Location src/sys/fileio/ftest.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/fileio/ftest.c) [Index of all Sys routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)