Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    The Netherlands
    Posts
    252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    mkdir() and file permissions

    Hi there,

    I'm having some troubles with the mkdir function and the file permissions. I've got the following code in my script:

    PHP Code:
    mkdir($this->_aConfig['path'], 0644); 
    This is supposed to create a new directory that is readible and writeble for the php-script itself. So I want to be able to create files and sub-derictories inside this newly created directory.

    The directory is in fact being made. However the file permissions appear to be 550 (according to WS-FTP). So the script is not allowed to write in the directory ....

    Can anyone tell me how I should change the code, for it to work?

    Thanx in advance! Michiel

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,096
    Thanks
    11
    Thanked 101 Times in 99 Posts
    can't see why the mode changes unless its something sneaky your host does ?

    regardless try chmodding to something wide open..

    PHP Code:
    <?
    mkdir
    ($dir,0777);
    ?>
    create any files or folders you want, then lock it up.
    <?
    chmod
    ($dir,0644);
    ?>
    now that is no more likely to work as your original ,butwho knows ?
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Brisbane, Australia
    Posts
    181
    Thanks
    1
    Thanked 0 Times in 0 Posts
    i've had some problems with the chmod() function. so try:

    mkdir($this->dirname);
    system("chmod 777 " $this->dirname);
    -mR_eGo
    _______________________
    Programming since
    3 years old.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •