Recursive Folders

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jestaji
Forum Newbie
Posts: 1
Joined: Wed Jun 21, 2006 8:29 am

Recursive Folders

Post by jestaji »

hi all,

i wonder how you can make a recursive folder.. ie, i want to create a folder on the server as someone uploads a file. imagining i have a main folder to which the files are uploaded..

i would wish to insert some conditions like if the count of the files reaches some limit (say 100) it should create a sub folder inside and transfer the remaining uploads to that sub-folder and so on..

in pure programing means i would say i mean to create a recursive folder.. I tried creating folders but recursion seems bit tuf.. it really counts the base folder hard....

Inviting brilliance & help to the destined abode to solve this chunk of code../

:)

Destiny of the hunk !!!!!

feyd | what's with people bolding and coloring entire posts today?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Why not have a folder which already has many subfolders which in tern have many more subfolders already so you can push the file into the correct slot without having to build a directory tree or figure out if you need to go deeper?

For instance, if you hashed the filename you could take the first character and second character as the folder and subfolder, respectively, that you dump the file into.
Post Reply