As the title says, there's a Directory.Move but no Directory.Copy
method in Directory class from System.IO. Is there a reason for that?
Update:
To me, the copy and move actions are pretty much identical, the only difference being that the move action does a copy and then deletes the destination. And the error handling is as complex for move as it is for copy. So if one is implemented, why isn't the other?
Update 2:
This is a quote from a comment from mmclean:
Directory.Move however does not move, it renames. Thus the "destination" path is a full path to point to the directory, rather than a location to "move into", and moving to a different drive is impossible.
So I understand that move actually does a rename operation (only changes and entry in the File Allocation Table). But both move and copy commands have the same problem with merging items existing in the destination (overwrite/keep both). So the only added complexity for the copy operation is that it has to physically copy files around. But that still doesn't explain the decision to not implement it. Even more so, when the copy command is implemented in VB.NET and there's a pretty simple implementation for a copy operation on MSDN here.