C
Ch Ba
I'm having a bit of a difficult time coming up with a solid way handle
this problem. I'll explain:
I have an array containing a list of file paths like the following.
["foo/bar/blah.rb","foo/bar/stuff.rb","foo/bar/example/thing.rb,"foo/ham/example"]
I need to come up with a way to create a directory structure using the
paths supplied in the array. The "base" directory is unimportant, but
the structure of the rest is. Using the above as an example, I would
need to create the following directories.
foo/bar
foo/bar/example
foo/ham
foo/ham/example
I also need to check whether or not the directory exists so that it
makes no attempt to create a directory that is already there. Any ideas?
this problem. I'll explain:
I have an array containing a list of file paths like the following.
["foo/bar/blah.rb","foo/bar/stuff.rb","foo/bar/example/thing.rb,"foo/ham/example"]
I need to come up with a way to create a directory structure using the
paths supplied in the array. The "base" directory is unimportant, but
the structure of the rest is. Using the above as an example, I would
need to create the following directories.
foo/bar
foo/bar/example
foo/ham
foo/ham/example
I also need to check whether or not the directory exists so that it
makes no attempt to create a directory that is already there. Any ideas?