473,326 Members | 2,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

mkdir sucks, really

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
3 3006
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Shaun | last post by:
Hello! I can't seem to get paths and variables working together: import os a = 'books' os.chdir( '/test') os.mkdir("/test/"a) the last line does not seem to work. os.mkdir(a) makes the...
16
by: zwetan | last post by:
Hi, often I see people telling that "javascript sucks" - is it because of the DOM with JS ? - is it because of the language in itself ? - is it because browsers/hosts differences ? - is it...
7
by: DataSmash | last post by:
Hello, I think I've tried everything now and can't figure out how to do it. I want to read in a text list from the current directory, and for each line in the list, make a system directory for...
8
by: Sue | last post by:
AccessXP in Access2000 Mode: In my code I use the MkDir method to create a folder and then I want to use the transfertext method to create a delimited text file in that folder. MkDir runs and...
5
by: eoindeb | last post by:
I am trying to create a directory on Solaris using the mkdir() function. This works fine when I pass a string literal ("/etc/hosts") to mkdir, but if I try passing a directory pointer to mkdir, it...
30
by: MikeC | last post by:
Good People, I'm writing a backup utility that uses a chdir() to go into the source directory (in which the files reside that I want to back up), so I don't want to use chdir() to get into the...
8
by: vj | last post by:
How do I do the following unix command: mkdir -m770 test with the os.mkdir command. Using os.mkdir(mode=0770) ends with the incorrect permissions. Thanks, VJ
4
by: John | last post by:
Hi The following does not create a directory neither does it give any error message. Any ideas? $umask=umask(0); $where="/var/www/vhosts/example.com/httpdocs/friday/"; mkdir ($where,0777);...
2
by: _q_u_a_m_i_s's | last post by:
Hy, i encountered a weird problem on a server running php5, and apache. Seems like i cannot create folders that end with "/". for example: mkdir("test/") will fail mkdir("test") will work Is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.