Returns the current offset for a file.
Compatibility:This function is compatible with the following targets:
|
ANSI
|
BeOS
|
EMB/RTOS
|
|
#include <unix.h>
long tell(int fildes);Parameters:
Parameters for this facility are:
If it is successful, tell() returns the offset. If it encounters an error, tell() returns -1L
#include <stdio.h>
#include <unix.h>
int main(void)
{
int fd;
long int pos;
fd = open("mytest", O_RDWR | O_CREAT | O_TRUNC);
write(fd, "Hello world!\n", 13);
write(fd, "How are you doing?\n", 19);
pos = tell(fd);
printf("You're at position %ld.", pos);
close(fd);
return 0;
}
Result
This program prints the following to standard output:
You're at position 32.
[ 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