dio_fcntl

(PHP 4 >= 4.2.0, PECL)

dio_fcntl -- Performs a c library fcntl on fd

Description

mixed dio_fcntl ( resource fd, int cmd [, mixed args] )

The dio_fcntl() function performs the operation specified by cmd on the file descriptor fd. Some commands require additional arguments args to be supplied.

args is an associative array, when cmd is F_SETLK or F_SETLLW, with the following keys:

cmd can be one of the following operations:

Przykład 1. Setting and clearing a lock

<?php

$fd
= dio_open('/dev/ttyS0', O_RDWR);

if (
dio_fcntl($fd, F_SETLK, Array("type"=>F_WRLCK)) == -1) {
   
// the file descriptor appears locked
   
echo "The lock can not be cleared. It is held by someone else.";
} else {
   echo
"Lock succesfully set/cleared";
}

dio_close($fd);
?>

Notatka: Ta funkcja nie jest dostępna na platformie Windows.

Hosting by: Hurra Communications Sp. z o.o.
Generated: 2007-01-26 18:02:43