Recipe 24.10. Making New Directories24.10.1. ProblemYou want to create a 24.10.2. SolutionUse mkdir( ), Making a directory
24.10.3. DiscussionThe second argument to mkdir( ) is the permission mode for the new directory, which must be an octal number. The current umask is taken away from this permission value to create the permissions for the new directory. So, if the current umask is 0002, calling mkdir('/tmp/apples',0777) sets the permissions on the resulting directory to 0775 (user and group can read, write, and execute; others can only read and execute). By default, mkdir( ) only creates a directory if its parent exists. For example, if /usr/local/images doesn't exist, you can't create /usr/local/images/puppies. To create a directory and its parents, pass true as a third argument to mkdir( ). This makes the function act recursively to create any missing parent directories. 24.10.4. See AlsoDocumentation on mkdir( ) at http://www.php.net/mkdir. |
Monday, January 25, 2010
Recipe 24.10. Making New Directories
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment