Page 1 of 1

Cannot use revCopyFolder to overwrite folder.

Posted: Tue May 26, 2009 4:11 am
by alex298
Hi,

I have problem to use revCopyFolder to overwrite old folder in the application default folder?

Here's my problem:

There are two folders (game and score) in the application default folder. There is also another folder (animal) inside the score folder. I wish to copy the animal folder (score/animal) to overwrite the game folder.

When I use the codes below, a new folder with the name game2 will be copy to the application default folder
revCopyFolder "score/animal, "game2"
Actually I wish to copy the folder and all it's content from score/animal to over-write the game folder. I tried to use the codes below:
revCopyFolder "score/animal, "game"
However a new folder with the name animal will be copy under the game folder, not over-write the game folder.

I also tried:
revCopyFolder "score/animal, ""
But it doesn't work.

Please help.

Thanks and best regards

Posted: Tue May 26, 2009 12:05 pm
by bn
Alex,
why dont you delete the old folder first and then do the revcopyfolder?
If revcopyfolder finds a folder with the same name at the destination then it changes the name automatically like in your case game2.
Actually copying a folder should not automatically replace an existing folder. That is not copying but replacing.
In an other setting you could test for the existence of a folder of the same name in the destination directory (if there is a folder "a/Folder/") and then delete that folder and then do revcopyfolder.
Is that what you mean?
regards
Bernd

Posted: Thu May 28, 2009 2:16 pm
by alex298
Dear Bernd,

Thanks for your help.
why dont you delete the old folder first and then do the revcopyfolder?
Actually my first idea is also delete the old folder and then do the revcopyFolder. However after some time, it comes to my thought that this should be much easier if the revCopyFolder can overwrite the old folder - only one step.

Thanks and best regards

Posted: Fri May 29, 2009 3:11 pm
by jsims
Hi Alex,

While I agree that 1 step would be more efficient, I would be concerned about the unintended consequences of revCopyFolder automatically replacing an existing folder.

If we want to be able to do such in one step, I would recommend a feature request for something like revReplaceFolder or revOverwriteFolder. That way, as a coder, I have the understanding that what I'm doing could be overwriting an existing folder. If the folder specified to overwrite doesn't exist, then this function would just do a normal copy.

Just my 2 cents.