:orphan: # PetscViewerWritable Return a flag whether the viewer can be written to with `PetscViewerWrite()` ## Synopsis ``` #include "petscviewer.h" PetscErrorCode PetscViewerWritable(PetscViewer viewer, PetscBool *flg) ``` Not Collective ## Input Parameter - ***viewer -*** the `PetscViewer` context ## Output Parameter - ***flg -*** `PETSC_TRUE` if the viewer is writable, `PETSC_FALSE` otherwise ## Note `PETSC_TRUE` means viewer is in a mode allowing writing, i.e. `PetscViewerFileGetMode()` returns one of `FILE_MODE_WRITE`, `FILE_MODE_APPEND`, `FILE_MODE_UPDATE`, `FILE_MODE_APPEND_UPDATE`. ## See Also [](sec_viewers), `PetscViewer`, `PetscViewerReadable()`, `PetscViewerCheckWritable()`, `PetscViewerCreate()`, `PetscViewerFileSetMode()`, `PetscViewerFileSetType()` ## Level intermediate ## Location src/sys/classes/viewer/interface/view.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/viewer/interface/view.c) [Index of all Viewer routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)