Loading ...
Sorry, an error occurred while loading the content.
 

Re: [phpXperts] Directory permissions

Expand Messages
  • M. Ashraful Anam
    Assuming ur using PHP to create the directories just use the fuction chmod . chmod( filename_with_path , 0644); A modified code from manual for dir function
    Message 1 of 5 , Jan 30, 2006
       
      Assuming ur using PHP to create the directories just use the fuction 'chmod'.
       
      chmod("filename_with_path", 0644);
       
      A modified code from manual for dir function might look like:
       
      <?php
      $d = dir("/usr/www/htdocs/path/");
      echo "Handle: " . $d->handle . "\n";
      echo "Path: " . $d->path . "\n";
      while (false !== ($entry = $d->read())) {
        echo $entry."\n";
        chmod($entry, 0644);
      }
      $d->close();
      ?>
      changes all permission of file in "/usr/www/htdocs/path/" to 644. If u want to change ownership also use the chown() function similarly.
       
       
      ----- Original Message -----
      From: Bhara
      Sent: Monday, January 30, 2006 11:08 PM
      Subject: [phpXperts] Directory permissions

      Hello Xperts,
      I need to create  some  directories as well and files on fly.
      and i need to set  write permission s for that  directories
      for ex:

      I should able to create a directory called"bar" and create a subfolder
      "foo" in that "bar " directory.

      I can able to create these folders. But i dont know how to set
      permissions for the directories.

      Please help me in this regards,
      Thanks in advance.






    • kray blue
      any guys who knows cpanel can anyone pls mail me off-list.. tia sl_ime M. Ashraful Anam wrote: Assuming ur using PHP to create the
      Message 2 of 5 , Jan 30, 2006
        any guys who knows cpanel can anyone pls mail me off-list..
         
        tia
         
        sl_ime

        "M. Ashraful Anam" <anam@...> wrote:
         
        Assuming ur using PHP to create the directories just use the fuction 'chmod'.
         
        chmod("filename_with_path", 0644);
         
        A modified code from manual for dir function might look like:
         
        <?php
        $d = dir("/usr/www/htdocs/path/");
        echo "Handle: " . $d->handle . "\n";
        echo "Path: " . $d->path . "\n";
        while (false !== ($entry = $d->read())) {
          echo $entry."\n";
          chmod($entry, 0644);
        }
        $d->close();
        ?>
        changes all permission of file in "/usr/www/htdocs/path/" to 644. If u want to change ownership also use the chown() function similarly.
         
         
        ----- Original Message -----
        From: Bhara
        Sent: Monday, January 30, 2006 11:08 PM
        Subject: [phpXperts] Directory permissions

        Hello Xperts,
        I need to create  some  directories as well and files on fly.
        and i need to set  write permission s for that  directories
        for ex:

        I should able to create a directory called"bar" and create a subfolder
        "foo" in that "bar " directory.

        I can able to create these folders. But i dont know how to set
        permissions for the directories.

        Please help me in this regards,
        Thanks in advance.









                    __  _
              ____ |  |(_)
            /     ||  | __  _      ,_  _______
           |    -- |  ||  |>  \/'\/  ||   __  |
            \   \  |  ||  ||  +-+-+  ||   ___/
          /+__\   \|  ||  ||  | | |  | \  \
        <           >         copyryt 2003 (r)


        Bring words and photos together (easily) with
        PhotoMail - it's free and works with Yahoo! Mail.

      • Ramesh
        Hello Ashraful, Thank you for giving me the answer. But I need to give the permission for the directory but not to a specific file. ... -- Regards, Ramesh My
        Message 3 of 5 , Jan 30, 2006
          Hello Ashraful,
          Thank you for giving me the answer.
          But I need  to give the permission for the directory but not to a specific file.



          On 1/30/06, M. Ashraful Anam <anam@...> wrote:
           
          Assuming ur using PHP to create the directories just use the fuction 'chmod'.
           
          chmod("filename_with_path", 0644);
           
          A modified code from manual for dir function might look like:
           
          <?php
          $d = dir("/usr/www/htdocs/path/");
          echo "Handle: " . $d->handle . "\n";
          echo "Path: " . $d->path . "\n";
          while (false !== ($entry = $d->read())) {
            echo $entry."\n";
            chmod($entry, 0644);
          }
          $d->close();
          ?>
          changes all permission of file in "/usr/www/htdocs/path/" to 644. If u want to change ownership also use the chown() function similarly.
           
           
          ----- Original Message -----
          From: Bhara
          Sent: Monday, January 30, 2006 11:08 PM
          Subject: [phpXperts] Directory permissions

          Hello Xperts,
          I need to create  some  directories as well and files on fly.
          and i need to set  write permission s for that  directories
          for ex:

          I should able to create a directory called"bar" and create a subfolder
          "foo" in that "bar " directory.

          I can able to create these folders. But i dont know how to set
          permissions for the directories.

          Please help me in this regards,
          Thanks in advance.








          Visit phpXperts website at www.phpxperts.com



          YAHOO! GROUPS LINKS






          --
          Regards,
          Ramesh

          'My beginning is always today'.
        • M. Ashraful Anam
          Well you could change the permission while creating the directory: or
          Message 4 of 5 , Jan 30, 2006
            Well you could change the permission while creating the directory:

            <?php
            mkdir("/path/to/dir", 0644);
            //gives 0644 permission to created dir 'dir'
            ?>

            or

            <?php
            mkdir("/path/to/dir");
            //creates the dir
            chmod("/path/to/dir", 0644);
            //gives 0644 permission to created dir 'dir'
            ?>


            > Hello Ashraful,
            > Thank you for giving me the answer.
            > But I need to give the permission for the directory but not
            > to a specific file.
            >
            > On 1/30/06, M. Ashraful Anam <anam@...> wrote:
            > >
            > >
            > > Assuming ur using PHP to create the directories just use the fuction
            > > 'chmod'.
            > >
            > > chmod("filename_with_path", 0644);
            > >
            > > A modified code from manual for dir function might look like:
            > >
            > > <?php
            > > $d = dir("/usr/www/htdocs/path/");
            > > echo "Handle: " . $d->handle . "\n";
            > > echo "Path: " . $d->path . "\n";
            > > while (false !== ($entry = $d->read())) {
            > > echo $entry."\n";
            > > chmod($entry, 0644);
            > > }
            > > $d->close();
            > > ?>
            > > changes all permission of file in "/usr/www/htdocs/path/" to 644. If u
            > > want to change ownership also use the chown() function similarly.
            > >
            > >
            > >
            > > ----- Original Message -----
            > > *From:* Bhara <ramesh.webdeveloper@...>
            > > *To:* phpexperts@yahoogroups.com
            > > *Sent:* Monday, January 30, 2006 11:08 PM
            > > *Subject:* [phpXperts] Directory permissions
            > >
            > > Hello Xperts,
            > > I need to create some directories as well and files on fly.
            > > and i need to set write permission s for that directories
            > > for ex:
            > >
            > > I should able to create a directory called"bar" and create a subfolder
            > > "foo" in that "bar " directory.
            > >
            > > I can able to create these folders. But i dont know how to set
            > > permissions for the directories.
            > >
            > > Please help me in this regards,
            > > Thanks in advance.
            > >
            > >
            > >
            > >
            > >
            > >
            > >
            > >
            > > Visit phpXperts website at www.phpxperts.com
            > >
            > >
            > > ------------------------------
            > > YAHOO! GROUPS LINKS
            > >
            > >
            > > - Visit your group "phpexperts<http://groups.yahoo.com/group/phpexperts>"
            > > on the web.
            > >
            > > - To unsubscribe from this group, send an email to:
            > >
            phpexperts-unsubscribe@yahoogroups.com<phpexperts-unsubscribe@yahoogroups.com?subject=Unsubscribe>
            > >
            > > - Your use of Yahoo! Groups is subject to the Yahoo! Terms of
            > > Service <http://docs.yahoo.com/info/terms/>.
            > >
            > >
            > > ------------------------------
            > >
            > >
            >
            > --
            > Regards,
            > Ramesh
            >
            > 'My beginning is always today'.
          • Zakir Hossain
            please describe your problems. -- Best Regard, Raju http://www.xenexbd.com - Xenex Web Solutions http://www.bd-host.com - Web Hosting Solutions
            Message 5 of 5 , Jan 31, 2006
              please describe your problems.


              --
              Best Regard,
              Raju
              http://www.xenexbd.com - Xenex Web Solutions
              http://www.bd-host.com  - Web Hosting Solutions
              http://xenexsolutions.com - Domain Names Solutions
              ----------------------------
            Your message has been successfully submitted and would be delivered to recipients shortly.