Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: posix_mknod - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

posix_setegid" width="11" height="7"/> <posix_mkfifo
Last updated: Mon, 05 Feb 2007

view this page in

posix_mknod

(PHP 5 >= 5.1.0)

posix_mknod — スペシャルファイルあるいは通常のファイルを作成する (POSIX.1)

説明

bool posix_mknod ( string pathname, int mode [, int major [, int minor]] )

スペシャルファイルあるいは通常のファイルを作成します。

パラメータ

pathname

作成するファイル。

mode

このパラメータは、ファイル型(以下の定数 POSIX_S_IFREGPOSIX_S_IFCHRPOSIX_S_IFBLKPOSIX_S_IFIFO あるいは POSIX_S_IFSOCK のうちのひとつ) およびパーミッションの論理和で構成されます。

major

メジャーデバイスカーネル ID (S_IFCHR あるいは S_IFBLK を使用している場合に渡す必要があります)。

minor

マイナーデバイスカーネル ID (デフォルトは 0 です)。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

例 1750. posix_mknod() の例

<?php

$file
= '/tmp/tmpfile'// ファイル名
$type = POSIX_S_IFBLK// ファイル型
$permissions = 0777;    // 8 進数
$major = 1;
$minor = 8;              // /dev/random

if (!posix_mknod($file, $type | $permissions, $major, $minor)) {
   die(
'Error ' . posix_get_last_error() . ': ' . posix_strerror(posix_get_last_error()));
}

?>

参考

posix_mkfifo()



add a note add a note User Contributed Notes
posix_mknod
There are no user contributed notes for this page.

posix_setegid" width="11" height="7"/> <posix_mkfifo
Last updated: Mon, 05 Feb 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites