Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : Direct IO Functions : dio_seek

dio_seek

Seeks to pos on fd from whence (PHP 4 >= 4.2.0, PHP 5 <= 5.0.5)
int dio_seek ( resource fd, int pos [, int whence] )

Example 501. Positioning in a file

<?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);
?>

Change Language


Follow Navioo On Twitter
dio_close
dio_fcntl
dio_open
dio_read
dio_seek
dio_stat
dio_tcsetattr
dio_truncate
dio_write
eXTReMe Tracker