Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Help with chmoding newly created dir
Old 12-18-2005, 10:43 PM Help with chmoding newly created dir
lerch's Avatar
Novice Talker

Posts: 5
Trades: 0
Hello all,
I'm coding a blog and I have a script that copys a directory. It works fine, but the newly copied dir's permissions are auto set to "0655". So I cant delete it or modify it. I have to get the system admin to do that. So if someone knows how to set it to chmod to 755, instead of 655 that would be great.

P.S. Ive already tried writing a script that attempts to chmod it after its created. (after the script is done) but I get permission errors. Here is the code:

PHP Code:
<?php
$source
"source";
$dest "newblog";

function 
COPY_RECURSIVE_DIRS($dirsource$dirdest)


global 
$source;
if(
is_dir($dirsource))$dir_handle=opendir($dirsource);

// creates the directory if it doesn't exist

if(!is_dir("$source/$dirdest/"))
{
echo 
"i am here :D";
mkdir("$dirdest/"0777);
}

while(
$file=readdir($dir_handle))
{
if(
$file!="." && $file!="..")
{
if(!
is_dir("$dirsource/$file"))
{

copy ("$dirsource/$file""$source/$file");

}
else 
COPY_RECURSIVE_DIRS("$dirsource/$file""$dirdest");
}
}
closedir($dir_handle);
return 
true;
}

COPY_RECURSIVE_DIRS("$source","$dest");
?>
thanks

Last edited by lerch; 12-20-2005 at 04:42 PM..
lerch is offline
Reply With Quote
View Public Profile Visit lerch's homepage!
 
 
Register now for full access!
Old 12-20-2005, 04:42 PM
lerch's Avatar
Novice Talker

Posts: 5
Trades: 0
I was able to fix the permissions, but now it wont copy the files inside of the source folder. Does anyone know why? :-/
lerch is offline
Reply With Quote
View Public Profile Visit lerch's homepage!
 
Reply     « Reply to Help with chmoding newly created dir
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10360 seconds with 12 queries