VMS Help  —  CRTL  fseek  Description
    The fseek function can position a fixed-length record-access
    file with no carriage control or a stream-access file on any
    byte offset, but can position all other files only on record
    boundaries.

    The available Standard I/O functions position a variable-length
    or VFC record file at its first byte, at the end-of-file, or on
    a record boundary. Therefore, the arguments given to fseek must
    specify any of the following:

    o  The beginning or end of the file

    o  A 0 offset from the current position (an arbitrary record
       boundary)

    o  The position returned by a previous, valid ftell call

    See the fgetpos and fsetpos functions for a portable way to seek
    to arbitrary locations with these types of record files.

                                 CAUTION

       If, while accessing a stream file, you seek beyond the
       end-of-file and then write to the file, the fseek function
       creates a hole by filling the skipped bytes with zeros.

       In general, for record files, fseek should only be directed
       to an absolute position that was returned by a previous
       valid call to ftell, or to the beginning or end of a file.
       If a call to fseek does not satisfy these conditions, the
       results are unpredictable.

    See also open, creat, dup, dup2, and lseek.
Close Help