# PetscViewerWritable
Return a flag whether the viewer can be written to 
## Synopsis
```
#include "petscviewer.h" 
PetscErrorCode PetscViewerWritable(PetscViewer viewer, PetscBool *flg)
```
Not Collective


## Input Parameters

- ***viewer -*** the `PetscViewer` context



## Output Parameters

- ***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
 `PetscViewer`, `PetscViewerReadable()`, `PetscViewerCheckWritable()`, `PetscViewerCreate()`, `PetscViewerFileSetMode()`, `PetscViewerFileSetType()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/interface/view.c.html#PetscViewerWritable">src/sys/classes/viewer/interface/view.c</A>


---
[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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
