This exercise takes a string that is an absolute path to a proposed directory structure, then (1) tests to see if the directories exist in the current path, and if they don't, (2) it creates them, setting the permissions to read/write. Otherwise, it moves on. I had to figure out this little bit in order to be able to make directories in the Creating a Grading Rubric Exercise. The script, fully commented, is here.This exercise points out an important aspect of creating a Web application: Things should pretty much just work without requiring a lot of thought. No dialogs, and few, if any, instructions. In this case, you enter the path where you want the output to go, and the script either puts the stuff there, or it creates the directories, and then puts the stuff there.
And then there's the pitfall. What happens in unexpected cases, for instance, where the user doesn't have permission to create directories, or that other big one, the one that nobody ever thought of? This is why we have updates.
Hey! It works on my machine.
0 comments:
Post a Comment