# PetscSynchronizedFGets
Several processors all get the same line from a file. 
## Synopsis
```
PetscErrorCode PetscSynchronizedFGets(MPI_Comm comm, FILE *fp, size_t len, char string[])
```
Collective


## Input Parameters

- ***comm -*** the communicator
- ***fd -*** the file pointer
- ***len -*** the length of the output buffer



## Output Parameter

- ***string -*** the line read from the file, at end of file string[0] == 0





## See Also
 `PetscSynchronizedPrintf()`, `PetscSynchronizedFlush()`,
`PetscFOpen()`, `PetscViewerASCIISynchronizedPrintf()`, `PetscViewerASCIIPrintf()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/fileio/mprint.c.html#PetscSynchronizedFGets">src/sys/fileio/mprint.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/fileio/mprint.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)  
