Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

posix_mknod(3) [php man page]

POSIX_MKNOD(3)								 1							    POSIX_MKNOD(3)

posix_mknod - Create a special or ordinary file (POSIX.1)

SYNOPSIS
bool posix_mknod (string $pathname, int $mode, [int $major], [int $minor]) DESCRIPTION
Creates a special or ordinary file. PARAMETERS
o $pathname - The file to create o $mode - This parameter is constructed by a bitwise OR between file type (one of the following constants: POSIX_S_IFREG, POSIX_S_IFCHR, POSIX_S_IFBLK, POSIX_S_IFIFO or POSIX_S_IFSOCK) and permissions. o $major - The major device kernel identifier (required to pass when using S_IFCHR or S_IFBLK). o $minor - The minor device kernel identifier. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 A posix_mknod(3) example <?php $file = '/tmp/tmpfile'; // file name $type = POSIX_S_IFBLK; // file type $permissions = 0777; // octal $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())); } ?> SEE ALSO
posix_mkfifo(3). PHP Documentation Group POSIX_MKNOD(3)

Check Out this Related Man Page

mknod(1M)						  System Administration Commands						 mknod(1M)

NAME
mknod - make a special file SYNOPSIS
mknod name b major minor mknod name c major minor mknod name p DESCRIPTION
mknod makes a directory entry for a special file. OPTIONS
The following options are supported: b Create a block-type special file. c Create a character-type special file. p Create a FIFO (named pipe). OPERANDS
The following operands are supported: major The major device number. minor The minor device number; can be either decimal or octal. The assignment of major device numbers is specific to each system. You must be the super-user to use this form of the command. name A special file to be created. USAGE
See largefile(5) for the description of the behavior of mknod when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
ftp(1), in.ftpd(1M), mknod(2), symlink(2), attributes(5), largefile(5) NOTES
If mknod(2) is used to create a device, the major and minor device numbers are always interpreted by the kernel running on that machine. With the advent of physical device naming, it would be preferable to create a symbolic link to the physical name of the device (in the /devices subtree) rather than using mknod. SunOS 5.11 16 Sep 1996 mknod(1M)
Man Page