(PHP 4 >= 4.2.0, PHP 5 < 5.1.0)
dio_seek — 在 fd 指定 pos 位置
fd
由 dio_open() 返回的文件描述符。
pos
新位置。
whence
指定如何解释 pos
的位置:
示例 #1 在文件中定位
<?php
$fd = dio_open('/dev/ttyS0', O_RDWR);
dio_seek($fd, 10, SEEK_SET);
// position is now at 10 characters from the start of the file
dio_seek($fd, -2, SEEK_CUR);
// position is now at 8 characters from the start of the file
dio_seek($fd, -5, SEEK_END);
// position is now at 5 characters from the end of the file
dio_seek($fd, 10, SEEK_END);
// position is now at 10 characters past the end of the file.
// The 10 characters between the end of the file and the current
// position are filled with zeros.
dio_close($fd);
?>