# PetscBinarySynchronizedSeek
Moves the file pointer on a PETSc binary file. 
## Synopsis
```
PetscErrorCode PetscBinarySynchronizedSeek(MPI_Comm comm, int fd, off_t off, PetscBinarySeekType whence, off_t *offset)
```

## Input Parameters

- ***fd -*** the file
- ***whence -*** if `PETSC_BINARY_SEEK_SET` then size is an absolute location in the file
if `PETSC_BINARY_SEEK_CUR` then size is offset from current location
if `PETSC_BINARY_SEEK_END` then size is offset from end of file
- ***off    -*** number of bytes to move. Use `PETSC_BINARY_INT_SIZE`, `PETSC_BINARY_SCALAR_SIZE`,
etc. in your calculation rather than `sizeof()` to compute byte lengths.



## Output Parameter

- ***offset -*** new offset in file





## Note
Integers are stored on the file as 32 long, regardless of whether
they are stored in the machine as 32 or 64, this means the same
binary file may be read on any machine. Hence you CANNOT use `sizeof()`
to determine the offset or location.


## See Also
 `PetscBinaryRead()`, `PetscBinaryWrite()`, `PetscBinaryOpen()`, `PetscBinarySynchronizedWrite()`, `PetscBinarySynchronizedRead()`,
`PetscBinarySynchronizedSeek()`

## Level
developer

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


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