PetscBinarySeek

Moves the file pointer on a PETSc binary file.

Synopsis

int PetscBinarySeek(int fd,int size,PetscBinarySeekType whence)
Not Collective

Output Parameter

fd - the file
whence - if BINARY_SEEK_SET then size is an absolute location in the file if BINARY_SEEK_CUR then size is offset from current location if BINARY_SEEK_END then size is offset from end of file
size - number of bytes to move. Use PETSC_INT_SIZE, BINARY_SCALAR_SIZE, etc. in your calculation rather than sizeof() to compute byte lengths.

Notes

Integers are stored on the file as 32 long, regardless of whetherthey are stored in the machine as 32 or 64, this means the samebinary file may be read on any machine. Hence you CANNOT use sizeof() to determine the offset or location.

Keywords

binary, output, write

See Also

PetscBinaryRead(), PetscBinaryWrite(), PetscBinaryOpen()

Location: src/sys/src/fileiosysio.c
System Index
Table of Contents