:orphan:
# PetscBinaryOpen
Opens a PETSc binary file.
## Synopsis
```
PetscErrorCode PetscBinaryOpen(const char name[], PetscFileMode mode, int *fd)
```
Not Collective
## Input Parameters
- ***name -*** filename
- ***mode -*** open mode of binary file, one of `FILE_MODE_READ`, `FILE_MODE_WRITE`, `FILE_MODE_APPEND``
## Output Parameter
- ***fd -*** the file
## See Also
`PetscBinaryRead()`, `PetscBinaryWrite()`, `PetscFileMode`, `PetscViewerFileSetMode()`, `PetscViewerBinaryGetDescriptor()`,
`PetscBinarySynchronizedWrite()`, `PetscBinarySynchronizedRead()`, `PetscBinarySynchronizedSeek()`
## Level
advanced
## Location
src/sys/fileio/sysio.c
## Examples
src/dm/tutorials/ex15.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/fileio/sysio.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)