Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

eio_link(3) [php man page]

EIO_LINK(3)								 1							       EIO_LINK(3)

eio_link - Create a hardlink for file

SYNOPSIS
resource eio_link (string $path, string $new_path, [int $pri = EIO_PRI_DEFAULT], [callable $callback = NULL], [mixed $data = NULL]) DESCRIPTION
eio_link(3) creates a hardlink $new_path for a file specified by $path. PARAMETERS
o $path - Source file path. o $new_path - Target file path. o $pri -The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL. If NULL passed, $pri internally is set to EIO_PRI_DEFAULT. o $callback -$callback function is called when the request is done. It should match the following prototype: void callback(mixed $data, int $result[, resource $req]); o $data -is custom data passed to the request. o $result -request-specific result value; basically, the value returned by corresponding system call. o $req -is optional request resource which can be used with functions like eio_get_last_error(3) o $data - Arbitrary variable passed to $callback. RETURN VALUES
EXAMPLES
Example #1 eio_link(3) example <?php $filename = dirname(__FILE__)."/symlink.dat"; touch($filename); $link = dirname(__FILE__)."/symlink.link"; $hardlink = dirname(__FILE__)."/hardlink.link"; function my_hardlink_cb($data, $result) { global $link, $filename; var_dump(file_exists($data) && !is_link($data)); @unlink($data); eio_symlink($filename, $link, EIO_PRI_DEFAULT, "my_symlink_cb", $link); } function my_symlink_cb($data, $result) { global $link, $filename; var_dump(file_exists($data) && is_link($data)); if (!eio_readlink($data, EIO_PRI_DEFAULT, "my_readlink_cb", NULL)) { @unlink($link); @unlink($filename); } } function my_readlink_cb($data, $result) { global $filename, $link; var_dump($result); @unlink($link); @unlink($filename); } eio_link($filename, $hardlink, EIO_PRI_DEFAULT, "my_hardlink_cb", $hardlink); eio_event_loop(); ?> The above example will output something similar to: bool(true) bool(true) string(%d) "%ssymlink.dat" SEE ALSO eio_symlink. PHP Documentation Group EIO_LINK(3)

Check Out this Related Man Page

EIO_MKDIR(3)								 1							      EIO_MKDIR(3)

eio_mkdir - Create directory

SYNOPSIS
resource eio_mkdir (string $path, int $mode, [int $pri = EIO_PRI_DEFAULT], [callable $callback = NULL], [mixed $data = NULL]) DESCRIPTION
eio_mkdir(3) creates directory with specified access $mode. PARAMETERS
o $path - Path for the new directory. o $mode - Access mode, e.g. 0755 o $pri -The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL. If NULL passed, $pri internally is set to EIO_PRI_DEFAULT. o $callback -$callback function is called when the request is done. It should match the following prototype: void callback(mixed $data, int $result[, resource $req]); o $data -is custom data passed to the request. o $result -request-specific result value; basically, the value returned by corresponding system call. o $req -is optional request resource which can be used with functions like eio_get_last_error(3) o $data - Arbitrary variable passed to $callback. RETURN VALUES
eio_mkdir(3) returns request resource on success or FALSE on error. EXAMPLES
Example #1 eio_mkdir(3) example <?php $temp_dirname = "eio-temp-dir"; /* Is called when eio_mkdir() finishes */ function my_mkdir_callback($data, $result) { if ($result == 0 && is_dir($temp_dirname) && !is_readable($temp_dirname) && is_writable($temp_dirname)) { echo "eio_mkdir_ok"; } // Remove directory if (file_exists($data)) rmdir($temp_dirname); } // Create directory with access mode 0300 eio_mkdir($temp_dirname, 0300, EIO_PRI_DEFAULT, "my_mkdir_callback", $temp_dirname); eio_event_loop(); ?> The above example will output something similar to: eio_mkdir_ok SEE ALSO eio_rmdir. PHP Documentation Group EIO_MKDIR(3)
Man Page