Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tell(3c) [opensolaris man page]

tell(3C)						   Standard C Library Functions 						  tell(3C)

NAME
tell - return a file offset for a file descriptor SYNOPSIS
#include <unistd.h> off_t tell(int fd); DESCRIPTION
The tell() function obtains the current value of the file-position indicator for the file descriptor fd. RETURN VALUES
Upon successful completion, tell() returns the current value of the file-position indicator for fd measured in bytes from the beginning of the file. Otherwise, it returns -1 and sets errno to indicate the error. ERRORS
The tell() function will fail if: EBADF The file descriptor fd is not an open file descriptor. EOVERFLOW The current file offset cannot be represented correctly in an object of type off_t. ESPIPE The file descriptor fd is associated with a pipe or FIFO. USAGE
The tell() function is equivalent to lseek(fd, 0, SEEK_CUR). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
lseek(2), attributes(5) SunOS 5.11 28 Jan 1998 tell(3C)

Check Out this Related Man Page

ftell(3C)						   Standard C Library Functions 						 ftell(3C)

NAME
ftell, ftello - return a file offset in a stream SYNOPSIS
#include <stdio.h> long ftell(FILE *stream); off_t ftello(FILE *stream); DESCRIPTION
The ftell() function obtains the current value of the file-position indicator for the stream pointed to by stream. The ftello() function is identical to ftell() except for the return type. RETURN VALUES
Upon successful completion, the ftell() and ftello() functions return the current value of the file-position indicator for the stream mea- sured in bytes from the beginning of the file. Otherwise, they return -1 and sets errno to indicate the error. ERRORS
The ftell() and ftello() functions will fail if: EBADF The file descriptor underlying stream is not an open file descriptor. ESPIPE The file descriptor underlying stream is associated with a pipe, a FIFO, or a socket. The ftell() function will fail if: EOVERFLOW The current file offset cannot be represented correctly in an object of type long. The ftello() function will fail if: EOVERFLOW The current file offset cannot be represented correctly in an object of type off_t. USAGE
The ftello() function has a transitional interface for 64-bit file offsets. See lf64(5). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
lseek(2), fopen(3C), fseek(3C), attributes(5), , standards(5), lf64(5) SunOS 5.11 24 Jul 2002 ftell(3C)
Man Page

4 More Discussions You Might Find Interesting

1. Programming

equivalent function for wherey( ) ??

what is the equivalent function for wherey( ) ?? That is to return the current column position? (2 Replies)
Discussion started by: rockgal
2 Replies

2. Shell Programming and Scripting

Passing a file descriptor

I am trying to right a function which uses a file descriptor to write to a log file. The problem is that the on the print statement the file descriptor is called bad. Now when I first open the file and print to it in the f_open function by passing the descriptor to f_print_log all works well,... (6 Replies)
Discussion started by: robotball
6 Replies

3. Programming

Hairy Problem! lseek over 4G

recently my project needs me to lseek a position over 4G size.... i found in linux or unix the parameters are all ulong 32 bits...the limit dooms the movement of a position over 4G I was told that i should lseek64 to meet my need... but i have no idea where i can get the function neither by "man... (8 Replies)
Discussion started by: macroideal
8 Replies

4. UNIX for Dummies Questions & Answers

lseek() equivalent

I know there is lseek() function that will allow to write or read from certain position in the file. Is there similar function that will let do same but for array rather then file? (9 Replies)
Discussion started by: joker40
9 Replies