[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


ftell

Return the current file position indicator value.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
#include <stdio.h>
long int ftell(FILE *stream);
Parameters:

Parameters for this facility are:

stream  
FILE *  
A pointer to a FILE stream  

Remarks:

The ftell() function returns the current value of stream's file position indicator. It is used in conjunction with fseek() to provide random access to a file.

The function will not work correctly when it is given a stream associated to a console file, such as stdin, stdout, or stderr, where a file indicator position is not applicable. Also, ftell() cannot handle files with sizes larger than what can be represented with a long int. In such a case, use the fgetpos() and fsetpos() functions.


NOTE

On embedded/ RTOS systems this function only is implemented for stdin, stdout and stderr files.
Return:

ftell(), when successful, returns the current file position indicator value. If it fails, ftell() returns -1L and sets the global variable errno to a nonzero value.

See Also:

"errno," "fgetpos"

For example of ftell() usage:
Refer to "Example of fseek() usage." for fseek().


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000