note 29233 added to function.file-exists
| From: | ralba at snapcube dot com | Date: | Thu, 06 Feb 2003 21:21:42 +0000 |
| Subject: | note 29233 added to function.file-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-43528@lists.php.net to get a copy of this message | ||
My problem is the following:
Over a year ago we developed a portal site for a client. The client at the last minute wanted users
to be able to create their own home page. We created code to build pages and it work without hitch
until now. The script before publishing checks to see if the user has a home direcotry and if not,
creates the directories and files rquired. This is needed in order for the code to work. Now the
site has 32,000 members, each with their own directory. The error that we are all of a sudden seeing
is;
Warning: MkDir failed (Too many links) in /home/dir/Page/MyPage2.php on line 474
Warning: MkDir failed (No such file or directory) in /home/dir/Page/MyPage2.php on line 475
Warning: MkDir failed (No such file or directory) in /home/dir/Page/MyPage2.php on line 476
The area of the code that is having the problem is:
$newDir ="/home/icaramba/members";
echo "<!-- /home/icaramba/members/$username/$username.php //-->";
if (!file_exists("/home/dir/members/$username/$username.php")) {
mkdir("$newDir/$username", 0775);
mkdir("$newDir/$username/pictures", 0775);
mkdir("$newDir/$username/itagz", 0775);
}
$uploadPath = "$newDir/$username/pictures"; // path where files are uploaded
What does "To many links" mean? Is it because there are to many directories to read from?
I know a year ago I should have hashed the directories but, we had no time and buget for that. Now
we are just trying to figure out the quick fix to get it to work again until the client raises more
capital.
Ray
--
http://www.php.net/manual/en/function.file-exists.php
http://master.php.net/manage/user-notes.php?action=edit+29233
http://master.php.net/manage/user-notes.php?action=delete+29233
http://master.php.net/manage/user-notes.php?action=reject+29233