Download pSOSystem System Calls

Transcript
psc.book Page 91 Monday, January 11, 1999 1:50 PM
pSOSystem System Calls
ftell
pREPC+ System Calls
Gets the file position indicator.
#include <stdarg.h>
#include <stdio.h>
long ftell(
FILE *stream
/* stream pointer */
)
Description
The ftell() function obtains the current value of the position indicator for the
stream pointed to by stream. This value can be passed to fseek() as an input parameter.
For a binary stream, the position indicator is the number of characters from the beginning of the file. For a text stream, the position indicator contains unspecified information, usable by fseek function.
If stream refers to an I/O device, this function does nothing and returns a zero.
Arguments
stream
Points to an open pREPC+ stream.
Return Value
If successful, this function returns the current file position indicator. It returns EOF
if an error occurs, and sets the errno.
Error Codes
Refer to Appendix A.
Notes
Callable From
■
ftell
Task
4-91
4