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



PHP : Function Reference : Direct IO Functions : dio_fcntl

dio_fcntl

Performs a c library fcntl on fd (PHP 4 >= 4.2.0, PHP 5 <= 5.0.5)
mixed dio_fcntl ( resource fd, int cmd [, mixed args] )

Example 499. 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);
?>

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