(ANSI Standard)
#include <stdio.h> stat = fgetpos(stream,pos);
The "fgetpos" function notes the current read/write position of stream and stores this information in the object indicated by "pos". Information obtained through "fgetpos" can be used by the "fsetpos" function to return to this same position.
The information stored by fgetpos has an implementation-specific format. There is no guarantee that this information may be useful in any other way except as an argument to "fsetpos".
The "fgetpos" function is similar to "ftell". The difference is that "ftell" must represent the current read/write position as a long value, whereas "fgetpos" uses the implementation-defined "fpos_t" type. Since "fpos_t" represents the read/write position in a form that is specifically tailored to the execution environment, "fgetpos" and its partner "fsetpos" are usually preferable to "ftell" and "fseek".
Copyright © 1996, Thinkage Ltd.