Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fgetpos(3S) — HP-UX 9.10

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fseek(3S)

fopen(3S)

popen(3S)

ungetc(3S)

fgetpos(3S)

NAME

fgetpos(), fsetpos() − save and restore a file position indicator for a stream

SYNOPSIS

#include <stdio.h>

int fgetpos(FILE *stream, fpos_t *pos);

int fsetpos(FILE *stream, const fpos_t *pos);

DESCRIPTION

fgetpos() Store the current value of the file position indicator for the stream pointed to by stream in the object pointed to by pos. The value stored contains information usable by fsetpos() for repositioning the stream to its position at the time of the call to fgetpos(). 

fsetpos() Set the file position indicator for the stream pointed to by stream according to the value of the object pointed to by pos, which must be a value set by an earlier call to fgetpos() on the same stream. 

A successful call to fsetpos() clears the end-of-file indicator for the stream and undoes any effects of ungetc(3S) on the same stream. After a fsetpos() call, the next operation on a update stream can be either input or output. 

RETURN VALUE

If successful, these functions return zero; otherwise non-zero. 

WARNINGS

Failure can occur if these functions are used on a file that has not been opened via fopen().  In particular, they must not be used on a terminal or on a file opened via popen(3S).

fsetpos() has no effect on streams that are open for append (see fopen(3S)).

SEE ALSO

fseek(3S), fopen(3S), popen(3S), ungetc(3S). 

STANDARDS CONFORMANCE

fgetpos(): AES, XPG4, ANSI C

fsetpos(): AES, XPG4, ANSI C

Hewlett-Packard Company  —  HP-UX Release 9.10: April 1995

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026