Reply to Mystery about chmod and permissions

Your name:

Reply:


Posted by Al on 10/09/05 22:49

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.?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация