On Monday 16 Jan 2012 17:31:01 you wrote:
> I recently wanted to create folders and files in the top directory
> relative to the one defined in "getDirectory" dialogue.
>
> By this, one gets no altering in a source folder and secondly I wanted
> to test RegularExpressions a bit.
>
> dir1 = getDirectory("SourceImages Directory");
> list1 = getFileList(dir1);
> //get top directory i.e. one level up
> topDir = replace(dir1, "([a-zA-Z0-9_]*)\\\\$", "");
Does not work under linux...
dir1 and topDir are the same.
I think the last line needs to be:
topDir = replace(dir1, "([a-zA-Z0-9_]*)\\"+File.separator+"\$", "");
note the File.separator for the differences between windows and unix (not sure
what macs use).
But this does not work either for folder names like "image.src.etc", so maybe
one also needs to include the "." or "\." ? Not sure which one.
Cheers
Gabriel