|
��������
fseek, rewind, ftell - ��������� ������� ������� ������
���������
#include <stdio.h> int fseek (stream, offset, ptrname) FILE *stream; long offset; int ptrname; void rewind (stream) FILE *stream; long ftell (stream) FILE *stream;
��������
������� fseek ������������� ������� ��������� ��������
�����/������ ��� ������ stream. ����� ������� ���������
�� ���������� offset ���� �� ������, �� ������� �������
��� �� �����, ����������� ������� ����� ����� � ����������� �� �������� ��������� ptrname (0, 1 ��� 2 ��������������). ���� �������� offset ������������, �� ����� ������� ����� ����������� ����� ����� �������.
�������� ������� rewind (stream) ��������� � ��������� ������� fseek (stream, 0L, 0). ������� ������ � ���, ��� ������� rewind �� ���������� �������� ��������.
������� fseek � rewind ���������� �������� ������� ungetc(3S).
� �����, �������� ��� ������ � ������, ����� ������ ������� fseek � rewind ��������� ��� �������� ������, ��� � ������.
������� ftell ���������� �������� ������� ������� ������������ ������ �����, ���������������� � ��������� ������� stream.
��. �����
lseek(2), fopen(3S), popen(3S), stdio(3S), ungetc(3S).
�����������
��� ��������� ���������� ������� fseek ���������� ��������� ��������, � ��������� ������ ��������� ����� 0.
������� ����� �� �������� ���, ��� ���� �� ��� ������
����������� ������� fopen; � ���������, ������� fseek
������ ������������ ��� �������, ��������������� � ����������, � ����� ��� ������, �������� ��������
popen(3S).
|