Документация PHP


dio_read

dio_stat

Direct IO Функции

PHP Manual


dio_seek

(PHP 4 >= 4.2.0, PHP 5 <= 5.0.5)

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($fd10SEEK_SET);
// position is now at 10 characters from the start of the file

dio_seek($fd, -2SEEK_CUR);
// position is now at 8 characters from the start of the file

dio_seek($fd, -5SEEK_END);
// position is now at 5 characters from the end of the file

dio_seek($fd10SEEK_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);
?>


dio_read

dio_stat

Direct IO Функции

PHP Manual

SAPE все усложнил?

MainLink - простая и прибыльная продажа ссылок!

Последние поступления:

Размещена 10 августа 2020 года

Я по ТВ видел, что через 10 лет мы будем жить лучше, чем в Германии...
Я не понял, что это они с Германией сделать хотят?!

читать далее…

ТехЗадание на Землю

Размещена 14 марта 2018 года

Пpоект Genesis (из коpпоpативной пеpеписки)

читать далее…

Шпаргалка по работе с Vim

Размещена 05 декабря 2017 года

Vim довольно мощный редактор, но работа с ним не всегда наглядна.
Например если нужно отредактировать какой-то файл например при помощи crontab, без знания специфики работы с viv никак.

читать далее…

Ошибка: Error: Cannot find a valid baseurl for repo

Размещена 13 сентабря 2017 года

Если возникает ошибка на centos 5 вида
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/

читать далее…

Linux Optimization

Размещена 30 июля 2012 года

Prelink

читать далее…