<< Previous | Next >>

ftell (FS1)

long ftell( File * f );

Description

Gets the offset from the beginning of a file that the read pointer is currently at.

TIP: ftell() can be used with fseek() to find the length of a file.

   

fseek(f, 0, SEEK_END);   // seek to the end of the file 
FileLength = ftell(f);   //
find the length of the file

Parameters

f
A pointer to the file to query.

Return value

The offset in bytes of the read pointer from the beginning of the file: Success.
-1: Failure.

Library

FILESYSTEM.LIB


Dynamic C Functions << Previous | Next >> rabbit.com