dio_open

(PHP 4 >= 4.2.0, PHP 5)

dio_open --  Opens a new filename with specified permissions of flags and creation permissions of mode

Description

resource dio_open ( string filename, int flags [, int mode])

dio_open() opens a file and returns a new file descriptor for it, or FALSE if any error occurred. If flags is O_CREAT, the optional third parameter mode will set the mode of the file (creation permissions). The flags parameter can be one of the following options:

The flags parameter can also include any combination of the following flags:

See also: dio_close().

Example 1. Setting the baud rate on a serial port

<?php

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

dio_close($fd);
?>