Ftell manual page






















Actually, ftell() gives more than an undefined result for append only streams; it gives the offset from the end of the file as defined before any data was appended. So if you open a file that had characters, and append 41 characters, and then execute ftell(), the value returned will be FTELL(3P) POSIX Programmer's Manual FTELL(3P) PROLOG top This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or . The fgetpos() and fsetpos() functions are alternate interfaces equivalent to ftell() and fseek() (with whence set to SEEK_SET), setting and storing the current value of the file offset into or from the object referenced by pos.


You can also move within the file-stream by using the functions, fseek, ftell, and rewind all defined in the same header file. For details pull up the following manual page by typing, $ man fseek. Getting data using fseek. If you have many records inside a file and need to access a record at a specific position, how would you do? An easier way to get to the required data can be achieved using fseek().fseek() let you "random access" a file. During file I/O, a long integer called offset is used to keep track of the next byte to read or write. The fseek () function sets the file position indicator for the stream pointed to by stream. The new position, measured in bytes, is obtained by adding offset bytes to the position specified by whence. If whence is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start of the file, the current position indicator, or end-of.


This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME. ftell, ftello - return a file offset in a stream SYNOPSIS. #include long ftell(FILE *stream);. FTELL(3P) POSIX Programmer's Manual FTELL(3P) PROLOG top This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. This document is a Mac OS X manual page. Manual pages are a command-line technology for providing documentation. You can view these manual pages locally using the man(1) command. These manual pages come from many different sources, and thus, have a variety of writing styles. For more information about the manual page format, see the manual page.

0コメント

  • 1000 / 1000