cancel
Showing results for 
Search instead for 
Did you mean: 

Recursively copy file and folder structure to existing one

absolute
Champ in-the-making
Champ in-the-making
Hi all,

I have some folder structure with files (content nodes) in folders and content nodes may have some additional associations, like renditions. I have another set of folder and files.
All I need is to recursively copy one set of files and folders on the top of another one, so that if for example a folder exists at destination, but some files or sub-folders are missing in it, they will be added. The same with other associations. Basically the behavior I want to achieve is similar to some file manager - you either skip and files are added or overwrite them.

Is there some more or less standard way to do this with CopyService? I checked the CopyCallbacks but did not find anything suitable. It is always possible to iterate over a directory tree manually, but it is not really what I want. 

Do you have any ideas about this?

Thanks in advance!
2 REPLIES 2

absolute
Champ in-the-making
Champ in-the-making
I have solved this with iterating over a child tree manually but copying with copy service node by node (without children) if the node does not exist at the target location. Works like a charm Smiley Happy

mimu
Champ in-the-making
Champ in-the-making
Could you be so nice to share your code as sample,
i woould like to do exactly the same.

Tahnkyou very much in advance
Michael