(PHP 4 >= 4.2.0, PHP 5 < 5.1.0)
dio_seek — 在 fd 指定 pos 位置
函数 dio_seek() 用于更改给定文件描述符的文件当前读/写位置。
示例 #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);
?>