Hi,
I'm writing a script that creates a server-side file structure based on arguments passed into the function. One of the features i need to implement involves iterating a number on the end of some of the created files depending on what already exists. For example, the basic file structure looks something like this:
.\Name\Type\Number\
then within the 'Number' directory, there are various files such as:
.\Name\Type\Number\A1
.\Name\Type\Number\B1
.\Name\Type\Number\C1
etc
.
.
.
It is possible to have more than 1 'A' directory, so there could be an 'A2', 'A3' etc... This means that i need to be able to check what directories already exist, and what number they are. For example... if i'm adding another 'A' directory, the function will only be told that another 'A' directory needs to be created. It needs to establish for itself if there are any 'A' directories already there, what number they are, and then create a new 'A' directory with the relevant number post-fixed.
If there is an 'A1' and 'A2' already in the structure, an 'A3' needs to be added.
Anyone able to recommend some useful functions or methods of implementation that might be helpful?
Thanks
Pile