Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 3/31/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

PXFLSEEK

POSIX Subroutine: Positions a file a specified distance in bytes.

Module

USE IFPOSIX

CALL PXFLSEEK (ifildes,ioffset,iwhence,iposition,ierror)

ifildes

(Input) INTEGER(4). A file descriptor.

ioffset

(Input) INTEGER(4). The number of bytes to move.

iwhence

(Input) INTEGER(4). The starting position. The value must be one of the following:

  • SEEK_SET = 0

    Sets the offset to ioffset bytes.

  • SEEK_CUR = 1

    Sets the offset to its current location plus ioffset bytes.

  • SEEK_END = 2

    Sets the offset to the size of the file plus ioffset bytes.

iposition

(Output) INTEGER(4). The ending position; the resulting offset location as measured in bytes from the beginning of the file.

ierror

(Output) INTEGER(4). The error status.

If successful, ierror is set to zero; otherwise, an error code.

The PXFLSEEK subroutine repositions the offset of file descriptor ifildes to the argument ioffset according to the value of argument iwhence.

PXFLSEEK allows the file offset to be set beyond the end of the existing end-of-file. If data is later written at this point, subsequent reads of the data in the gap return bytes of zeros (until data is actually written into the gap).