By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,751 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

mkdir sucks, really

P: n/a
OK, I do this call on a linux system:

if(!file_exists("../pages/".$_POST['ParentName']."/"))
{
$dirname = "/home/u2/sss/sss/html/pages/".$_POST['ParentName']."";
mkdir($dirname, $mode);

}

and get this:

Warning: mkdir() [function.mkdir]: File exists in /home/u2/mypage.php
on line 19

When it clearly doesn't exist! I looked!

HELP!

Jun 1 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
rf

"Cris" <ba************@gmail.comwrote in message
news:11**********************@o11g2000prd.googlegr oups.com...
OK, I do this call on a linux system:

if(!file_exists("../pages/".$_POST['ParentName']."/"))
{
$dirname = "/home/u2/sss/sss/html/pages/".$_POST['ParentName']."";
mkdir($dirname, $mode);

}

and get this:

Warning: mkdir() [function.mkdir]: File exists in /home/u2/mypage.php
on line 19

When it clearly doesn't exist! I looked!
Do ../pages/ and /home/u2/sss/sss/html/pages/ resolve to exactly the same
place?

--
Richard.
Jun 1 '07 #2

P: n/a
At Fri, 01 Jun 2007 04:20:18 +0000, Cris let h(is|er) monkeys type:
OK, I do this call on a linux system:

if(!file_exists("../pages/".$_POST['ParentName']."/"))
{
$dirname = "/home/u2/sss/sss/html/pages/".$_POST['ParentName']."";
mkdir($dirname, $mode);

}

and get this:

Warning: mkdir() [function.mkdir]: File exists in /home/u2/mypage.php
on line 19

When it clearly doesn't exist! I looked!

HELP!
What does $_POST['Parentname'] contain ? Echo it's value to check.
The warning would make sense if it's empty. And get rid of the '/' in the
file_exists line. At best it doesn't make a difference.

Why use a relative path first, followed by an absolute path?

mkdir doesn't suck, really. It creates a directory or returns false and
throws a warning if that process fails.

--
Schraalhans Keukenmeester - sc*********@the.Spamtrapexample.nl
[Remove the lowercase part of Spamtrap to send me a message]

"strcmp('apples','oranges') < 0"

Jun 1 '07 #3

P: n/a
On May 31, 11:56 pm, Schraalhans Keukenmeester
<Schraalh...@the.spamtrapexample.nlwrote:
At Fri, 01 Jun 2007 04:20:18 +0000, Cris let h(is|er) monkeys type:
OK, I do this call on a linux system:
if(!file_exists("../pages/".$_POST['ParentName']."/"))
{
$dirname = "/home/u2/sss/sss/html/pages/".$_POST['ParentName']."";
mkdir($dirname, $mode);
}
and get this:
Warning: mkdir() [function.mkdir]: File exists in /home/u2/mypage.php
on line 19
When it clearly doesn't exist! I looked!
HELP!

What does $_POST['Parentname'] contain ? Echo it's value to check.
The warning would make sense if it's empty. And get rid of the '/' in the
file_exists line. At best it doesn't make a difference.

Why use a relative path first, followed by an absolute path?

mkdir doesn't suck, really. It creates a directory or returns false and
throws a warning if that process fails.

--
Schraalhans Keukenmeester - schraalh...@the.Spamtrapexample.nl
[Remove the lowercase part of Spamtrap to send me a message]

"strcmp('apples','oranges') < 0"
Yes, I guess my monkeys were typing my code indeed.
They did resolve to the same place, BUT, Schraalhans was right.
$_POST['ParentName'] should have been $_POST['fileName'].
I got the two switched on the previous page. :O I feel sheepish.

I went through all the stuff at php.net and couldn't figure it out.
BTW I changed them both to absolute paths.

Thanks for your help.

Jun 2 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.