# PetscOptionsInsertFileYAML
Insert a YAML-formatted file in the options database 
## Synopsis
```
#include "petscsys.h"  
PetscErrorCode PetscOptionsInsertFileYAML(MPI_Comm comm, PetscOptions options, const char file[], PetscBool require)
```
Collective


## Input Parameters

- ***comm -*** the processes that will share the options (usually `PETSC_COMM_WORLD`)
- ***options -*** options database, use NULL for default global database
- ***file -*** name of file
- ***require -*** if `PETSC_TRUE` will generate an error if the file does not exist



## Notes
PETSc will generate an error condition that stops the program if a YAML error
is detected, hence the user should check that the YAML file is valid before
supplying it, for instance at http://www.yamllint.com/ .

Uses `PetscOptionsInsertStringYAML()`.




## See Also
 `PetscOptionsSetValue()`, `PetscOptionsView()`, `PetscOptionsHasName()`, `PetscOptionsGetInt()`,
`PetscOptionsGetReal()`, `PetscOptionsGetString()`, `PetscOptionsGetIntArray()`, `PetscOptionsBool()`,
`PetscOptionsName()`, `PetscOptionsBegin()`, `PetscOptionsEnd()`, `PetscOptionsHeadBegin()`,
`PetscOptionsStringArray()`, `PetscOptionsRealArray()`, `PetscOptionsScalar()`,
`PetscOptionsBoolGroupBegin()`, `PetscOptionsBoolGroup()`, `PetscOptionsBoolGroupEnd()`,
`PetscOptionsFList()`, `PetscOptionsEList()`, `PetscOptionsInsertFile()`, `PetscOptionsInsertStringYAML()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/objects/optionsyaml.c.html#PetscOptionsInsertFileYAML">src/sys/objects/optionsyaml.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/optionsyaml.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
