Mystery about chmod and permissions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've got a script that checks a directory's permissions for 757 and if they are not correct, chmods them with a cgi script.

That part works just fine. Can alternately switch the permissions from 755 to 757 and back. I can use a ftp utility to check the permissions and they are correct.

The mystery is that I have a permissions check following the chmod and it reports the permissions that existed before the change.

snippets:

include "http://$server/cgi-bin/chg_perms.cgi?name=$fp_name&perms=$fperms";;  //e.g., $fperms= 0757;

[I've tried sleep(10) here; doesn't help]

echo "Directory permissions for $dirname:  ". substr(sprintf('%o', fileperms($dirname)), -3). "  //reports 0755;

If I run the script again with the same permissions, the report shows the correct permissions.

It's as if permissions check code is executed before the chmod; but it isn't. I've tried echoed the times for the chmod code and the permissions check and the chmod code is definitely before the permissions check.

Anyone have an explanation.?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux