No description provided.
What should be the behavior on the various error conditions? Since this is a fairly complex operation many assumptions or options have to be coded.
Some problems include:
Should the whole operation fail early on error, should it check for possible errors before starting real work, should it ignore errors as best and continue working where possible?
Also, not errors, but what if the destination is a sub-folder of the source tree? Care needs to be taken to ensure the newly created files aren't copied again recursively.
jsDAV does the following: "copy: This method must work recursively and delete the destination if it exists"
this would get rid of most of the edge cases. An alternative could also be to fail if the destination folder exists. Then the client needs to resolve this conflict.
If the destination is a sub-folder of the source tree we should also return an error.
Sounds good, we can error out if the destination folder exists or is a subfolder. That still leaves the edge case of when a source file or folder is not readable. Should we stop of first error, continue past any errors, or check the entire tree in a pre-flight step? (and even with a pre-flight check, things can change after the fact, so errors are still possible, but much less likely)
Sounds good. My suggestion:
We could add the prefilght check as an option to step 1. For cloud9 it is not likely to cause any problems without the preflight.
add recursive option to rmdir. fixes #3