I am working with a database which consists of two tables. Category and Sub-Category. A category can have many sub-categories and each sub-category can have many stories. On entry of a new sub-category into the database I need to create a new folder to hold the stories for that specific sub-category. I need to check if the folder exist, and if so enter the associted stories, if not create a new folder. How do I go about accomplishing this and how do I create the text files in the correct folder?