Rory, What a great idea to use Java for something useful! I thought it was only for solving Cattle Drive assignments!
I tried this out straightaway and I'm sorry to say it doesn't appear to work as is. Using method mkdirs instead of mkdir seems to work OK but I haven't read up on it yet so not sure if that's a good fix...
I'm getting into Servlets at the moment so I think I'll be needing this. Thanks!
By the way - (general question) Is there any way to copy code from a forum thread in such a way that it does not paste into the editor as one lo-o-o-ong line?
Joined: Aug 03, 2007
I cannot tell you how delighted I am that a fellow student of the Cattle Drive might use some of my code.
I actually had you in mind when I posted it because I knew you were a little further down the trail than I am, you're already in Sevlets Creek.
mkdir() creates the directory you specify
mkdirs() creates the specified directory and any required parent directories
the reason you needed mkdirs is because you were not starting from the same point as me, ie you did not have Tomcat installed in c:\tc6 and probably did not have c:\javafiles\servlets.
I should have thought more before posting, we live and learn. You may need to edit the code to account for your chosen installation location.