Windows - C#- Directory.Move
Is it guaranteed that Directory.Move only renames and not copy/delete as long as it is on the same logical driv开发者_高级运维e?
In fact Directory.Move
fails if you attempt to move a directory to a different volume. If you want to perform such a move you have to do the Copy/Delete yourself. I think you can safely assume that Directory.Move
will only ever succeed if the operation can be performed without copying files.
Directory.Move
is an atomic operation if that's what you're getting at. It doesn't do it as 2 operations. On NTFS at least.
精彩评论