ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> phpdoc
phpdoc
[PHP-DOC] cvs: phpdoc /en/reference/posix/functions posix-mknod.xml
by Derick Rethans other posts by this author
Nov 2 2005 7:49AM messages near this date
[PHP-DOC] 1 | [PHP-DOC] cvs: phpdoc /entities global.ent
derick		Wed Nov  2 10:49:15 2005 EDT

  Modified files:              
    /phpdoc/en/reference/posix/functions	posix-mknod.xml 
  Log:
  - Fixed example and add some constraints.
  
  
http://cvs.php.net/diff.php/phpdoc/en/reference/posix/functions/posix-mknod.xml?r1=1.1&r2=1.
2&ty=u
Index: phpdoc/en/reference/posix/functions/posix-mknod.xml
diff -u phpdoc/en/reference/posix/functions/posix-mknod.xml:1.1 phpdoc/en/reference/posix/fu
nctions/posix-mknod.xml:1.2
--- phpdoc/en/reference/posix/functions/posix-mknod.xml:1.1	Sun May 15 13:20:13 2005
+++ phpdoc/en/reference/posix/functions/posix-mknod.xml	Wed Nov  2 10:49:11 2005
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?> 
-<!-- $Revision: 1.1 $ --> 
+<!-- $Revision: 1.2 $ --> 
 <refentry id="function.posix-mknod"> 
  <refnamediv> 
   <refname> posix_mknod</refname>
@@ -49,7 +49,8 @@
      <term> <parameter>major</parameter></term>
      <listitem> 
       <para> 
-       The major device kernel identifier
+       The major device kernel identifier (required to pass when you're using
+       <constant> S_IFCHR</constant> or <constant>S_IFBLK</constant>).
       </para> 
      </listitem> 
     </varlistentry> 
@@ -57,7 +58,7 @@
      <term> <parameter>minor</parameter></term>
      <listitem> 
       <para> 
-       The minor device kernel identifier
+       The minor device kernel identifier (defaults to 0).
       </para> 
      </listitem> 
     </varlistentry> 
@@ -82,10 +83,12 @@
 <?php
 
 $file = '/tmp/tmpfile';  // file name
-$type = POSIX_S_IFBLOCK; // file type
+$type = POSIX_S_IFBLK;   // file type
 $permissions = 0777;     // octal
+$major = 1;
+$minor = 8;              // /dev/random
 
-if (!posix_mknod($file, $type | $permissions)) {
+if (!posix_mknod($file, $type | $permissions, $major, $minor)) {
     die('Error ' . posix_get_last_error() . ': ' . posix_strerror(posix_get_last_error()));
 }
 

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved