php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #11046 mkdir doesnt sets permissions
Submitted: 2001-05-23 05:19 UTC Modified: 2001-07-07 23:51 UTC
From: javieracastro at hotmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.0.4pl1 OS: Linux
Private report: No CVE-ID: None
 [2001-05-23 05:19 UTC] javieracastro at hotmail dot com
mkdir("test",0777)

the directory is dwrx-rx-rx, not dwrxwrxwrx :)

why?

or it is my server with some rare php config?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-23 05:32 UTC] sniper@php.net
Your umask setting is most likely the cause.
Please try this instead:

<?php

$oldumask = umask(0); 
mkdir('mydir', 0777); 
umask($oldumask);

?>
 [2001-06-27 02:24 UTC] danbeck@php.net
This is not a documentation problem.
 [2001-06-27 12:02 UTC] sniper@php.net
This is documentation problem. It should be told on the mkdir() docs that the umask has an affect on the permissions of the created directory.

 [2001-07-07 23:51 UTC] jimw@php.net
noted in documentation.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 01:01:28 2024 UTC