PDA

View Full Version : Can folders be created via script instructions ?


songboy
01-24-2010, 09:02 PM
I've got to make a decison about storage of files. My ID system within mysql will cope with storing and getting data but I'm concerned about whether you can automatically create a folder to receive posted files. For example, I think it might be useful to gather a set of song files for one author into one folder which can be accessed by a music player. As such, I'd like to know if creating a new folder on the fly is a possibility using php scripting.
If it is possible, could somebody explain how it's done.
Thanks -
Songboy

tux
01-25-2010, 07:00 AM
Never used it myself but try....

mkdir() //add directory

and....

rmdir() // remove directory

You can find out more about it here.....

http://php.net/manual/en/function.mkdir.php

Hope this helps.

Paul

davidj
01-25-2010, 11:49 AM
You can also pass in full OS commands by using system()

For example, you can interact with your OS (Linux) using...

system("zip file.zip file1 file2 file3 *.txt")system("mkdir dirname")system("mv movefilename path/newfilename")