Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

fsetpos(3s) [ultrix man page]

fgetpos(3s)															       fgetpos(3s)

       fgetpos, fsetpos - save and restore stream position

       #include <stdio.h>

       int fgetpos (stream, pos)
       FILE *stream;
       fpos_t *pos;

       int fsetpos (stream, pos)
       FILE *stream;
       fpos_t *pos;

       The function stores the current position of stream in pos.

       The function restores stream to the position returned by an earlier call.

Return Values
       If successful, the return value is zero; on failure, a nonzero value is returned and errno is set to the appropriate value.

See Also


Check Out this Related Man Page

fgetpos(3C)						   Standard C Library Functions 					       fgetpos(3C)

fgetpos - get current file position information SYNOPSIS
#include <stdio.h> int fgetpos(FILE *stream, fpos_t *pos); DESCRIPTION
The fgetpos() function stores the current value of the file position indicator for the stream pointed to by stream in the object pointed to by pos. The value stored contains unspecified information usable by fsetpos(3C) for repositioning the stream to its position at the time of the call to fgetpos(). RETURN VALUES
Upon successful completion, fgetpos() returns 0. Otherwise, it returns a non-zero value and sets errno to indicate the error. ERRORS
The fgetpos() function may fail if: EBADF The file descriptor underlying stream is not valid. ESPIPE The file descriptor underlying stream is associated with a pipe, a FIFO, or a socket. EOVERFLOW The current value of the file position cannot be represented correctly in an object of type fpos_t. USAGE
The fgetpos() 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 | +-----------------------------+-----------------------------+ SEE ALSO
fopen(3C), fsetpos(3C), ftell(3C), rewind(3C), ungetc(3C), attributes(5), lf64(5), standards(5) SunOS 5.11 24 Jul 2002 fgetpos(3C)
Man Page

5 More Discussions You Might Find Interesting

1. Programming

fread64 fwrite64 compilation problem (undefined symbol)

I use a standard C source to access large files in a 32 bit environment. I've replaced fopen, fwrite and fread by fopen64, fwrite64 and fread64. First I did a test only replacing fopen by fopen64, it compiled without any other changes to my compilation options. The program crashed on a write, as... (3 Replies)
Discussion started by: Isax50
3 Replies

2. Programming

Hi Urgent

Hi Im launching another applicaTION from my "C" program. Is there any way to capture the application output only. Example. printf ("U have pressed 1\n"); system("ls -l"); printf (" U have launched a command\n"); Any way to capture only output from the system ("ls -l") command.... (5 Replies)
Discussion started by: yhacks
5 Replies

3. Programming

C reading file

Hi, how can i read first line two times without close file? (9 Replies)
Discussion started by: littleboyblu
9 Replies

4. Programming

Jumping to a particular line in a file

Hi, I have an output file which has more than 1,000,000,000 lines. I am accessing this file in another C++ program. Now while accessing the output file using cin, I want to jump, say, to the 5,000,000th line directly and start accessing data from there. Is this possible? Could someone please... (4 Replies)
Discussion started by: mugga
4 Replies

5. Programming

Incompatible data type fpos_t in C

This is from a program I wrote over in 1998 that I am trying to compile on a linux machine: void write_line (FILE *fp, int rec_no, line_rec *arec) { fpos_t woffset; woffset = (rec_no - 1) * sizeof(line_rec); fsetpos(fp,&woffset); fwrite(arec,sizeof(line_rec),1,fp); }On the line... (2 Replies)
Discussion started by: wbport
2 Replies