PDA

View Full Version : make directory


Jolten
09-03-2005, 07:43 AM
Hi,

I'm looking for something that can check to see if a directory exists titled $bbuserinfo['username'] and if not create a directory named $bbuserinfo['username'] after the currently browsing user.

I'm okay with php but I've never worked with directories before. At least not creating them. I'm reviewing php.net on it but if someone could give me some helpful tips I'd appreciate it.

The directories will simply store images.

Guest190829
09-03-2005, 07:55 AM
Hello,

I'm doing the same thing with vbspace, some functions that may help you are

1.) opendir() - much like fopen, it returns a directory handle

2.) mkdir() - has two parameters, the path to the new directory, and two the permissions it will take.

mkdir is a difficult functions, sometimes I set permissions and I get a completely different permisson. I'm currently trying to figure out exactly what im doing wrong. Hope that helps...

Marco van Herwaarden
09-03-2005, 09:32 AM
I think you can also use if_exists() to check if it ....exists. :D

Guest190829
09-03-2005, 09:13 PM
You can also test if opendir() returns false, and if it does, run mkdir().

That's how I do it atleast..