开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜