Directory.Move, but not Directory.Copy? [Kit George]

Blane Nelson enquired about Directory.Copy:

Why does the directory object have a static method to move a directory but not one to copy a directory.  Was this an oversite?

I wouldn't call it an oversight necessarily Blane: we explicitly didn't include this functionality on the basis that it's not difficult to code this yourself and the number of varying factors (copy subdirs, throw an exception on first fail, throw an exception if there is A failure, but attempt all copies, etc.) makes a weird decision tree. Rather than get mixed up in that in the past, we simply left it up to you.

However, we are considering doing this in the future. Keep an eye out in Whidbey for an API which provides a DirectoryCopy capability, and we will also be considering other places to include this functionality, post-Whidbey.

Comments (2)

  1. Anonymous says:

    System.IO.Directory.Copy(…) does not exist

Skip to main content