I'm stumped.
on my www server, I have a number of directories.
This script:
<? echo getcwd; ?>
returns:
/home/myUserName/public_html/myDirectory
Now I have a little script that creates a directory 'mySubDirectory', does some stuff, and drops a file into that directory.
If the subdirectory doesn't exist, I create it:
$dir = "mySubDirectory";
$created=file_exists($dir);
if (!$created) {
$blank = umask();
mkdir ("$dir", 0777);
chmod ("$dir", 0777);
etc...
This only works, of course , if myDirectory permissions are 777 or something similar.
I'm getting tired of using my FTP program or cpanel to change these permissions, so I thought I'd do a little script to change the cwd permissions before I create the mySubDirectory
I've tried stuff for about an hour; here's a sample:
$holdername= getcwd();
$y=chmod($holdername,0777);
I've tried chdir('..'), chmod on the working directory...lots of stuff.
I'm beat. Time to ask the experts...