Archive: same path-structure in different directories


same path-structure in different directories
hy there.

1. for creating a script, that creates automaticaly patches of my software, i need this function:
first, list the whole content (all files including subdirs) of the new directory (containing the latest files).

2. then it should scan the other directory, for the same files in the same directories. for every file that exists in an old and a new version, it should automaticaly create a patch-file with genpat.exe from the vpatch-plugin in a third directory (with same subdirs).

3. if there's no old version for the new file, it should copy the complete new file to the patch-directory (in the correct subdir).

now, i've mentioned those actions as single functions, but they will be done in batch-work, means, that every time a new file has been found, the script would look after an old version, and patch and so on.

i've already solutions to search through the new directory.
i also know how to create patches and copy files. but i've problems to keep the same path-structure in different root-directories.

e.g. 'c:\test\old\...' contains all the old files, c:\test\new\... the new ones and all the patch-files should be copied to c:\test\patch\...

did anyone understand my horrible english? :D
an if yes, does anyone know, how to do this?

thanx for any help


You should simply keep the current directory in a variable, trim the base path off it and append it to the patch path (C:\test\patch\<dir>\<filename>). The current directory is known already if you search the new and old paths recursively, so it shouldn't be a problem.


how could i trim the base path from the current directory?


You can get the length of the base path and start copying only after it using StrCpy's offset parameter.


thx very much!!!