|
 |
dio_seek (PHP 4 >= 4.2.0, PHP 5 <= 5.0.4) dio_seek -- Seeks to pos on fd from whence Описаниеint dio_seek ( resource fd, int pos [, int whence] )
The function dio_seek() is used to change the
file position of the given file descriptor.
Список параметров
- fd
The file descriptor returned by dio_open().
- pos
The new position.
- whence
Specifies how the position pos should be
interpreted:
SEEK_SET (default) - specifies that
pos is specified from the beginning of the
file.
SEEK_CUR - Specifies that
pos is a count of characters from the current
file position. This count may be positive or negative.
SEEK_END - Specifies that
pos is a count of characters from the end of
the file. A negative count specifies a position within the current
extent of the file; a positive count specifies a position past the
current end. If you set the position past the current end, and
actually write data, you will extend the file with zeros up to that
position.
Примеры
Пример 1. Positioning in a file
<?php
$fd = dio_open('/dev/ttyS0', O_RDWR);
dio_seek($fd, 10, SEEK_SET);
dio_seek($fd, -2, SEEK_CUR);
dio_seek($fd, -5, SEEK_END);
dio_seek($fd, 10, SEEK_END);
dio_close($fd);
?>
|
|
dio_seek
There are no user contributed notes for this page.
| |