# PetscViewerFileGetName
Gets the name of the file the `PetscViewer` uses. 
## Synopsis
```
#include "petscviewer.h" 
PetscErrorCode PetscViewerFileGetName(PetscViewer viewer, const char **name)
```
Not Collective


## Input Parameter

- ***viewer -*** the `PetscViewer`; either `PETSCVIEWERASCII` or `PETSCVIEWERBINARY`



## Output Parameter

- ***name -*** the name of the file it is using





## See Also
 [](sec_viewers), `PetscViewerCreate()`, `PetscViewerSetType()`, `PetscViewerASCIIOpen()`, `PetscViewerBinaryOpen()`, `PetscViewerFileSetName()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/ascii/filev.c.html#PetscViewerFileGetName">src/sys/classes/viewer/impls/ascii/filev.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/plexexodusii.c.html#PetscViewerFileGetName_ExodusII">PetscViewerFileGetName_ExodusII in src/dm/impls/plex/plexexodusii.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/adios/adios.c.html#PetscViewerFileGetName_ADIOS">PetscViewerFileGetName_ADIOS in src/sys/classes/viewer/impls/adios/adios.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/ascii/filev.c.html#PetscViewerFileGetName_ASCII">PetscViewerFileGetName_ASCII in src/sys/classes/viewer/impls/ascii/filev.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/binary/binv.c.html#PetscViewerFileGetName_Binary">PetscViewerFileGetName_Binary in src/sys/classes/viewer/impls/binary/binv.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/cgns/cgnsv.c.html#PetscViewerFileGetName_CGNS">PetscViewerFileGetName_CGNS in src/sys/classes/viewer/impls/cgns/cgnsv.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/hdf5/hdf5v.c.html#PetscViewerFileGetName_HDF5">PetscViewerFileGetName_HDF5 in src/sys/classes/viewer/impls/hdf5/hdf5v.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/vtk/vtkv.c.html#PetscViewerFileGetName_VTK">PetscViewerFileGetName_VTK in src/sys/classes/viewer/impls/vtk/vtkv.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/vu/petscvu.c.html#PetscViewerFileGetName_VU">PetscViewerFileGetName_VU in src/sys/classes/viewer/impls/vu/petscvu.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/viewer/impls/ascii/filev.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)  
