Bizarre directory delete behaviour on SSD drive

前端 未结 6 742
遇见更好的自我
遇见更好的自我 2021-01-01 10:25

Directory c:\\test has 50 or so files in it, no subdirectories.

    If IO.Directory.Exists(\"C:\\test\") Then
        IO.Directory.Delete(\"C:\\test\", True)         


        
6条回答
  •  生来不讨喜
    2021-01-01 11:20

    Yes, it has nothing to do with SSD drive. I had same problem but only on a client laptop. I am using .NET 3.5. In my case, the directory had a single file. CreateDirectory seems to be executing first internally before Delete is finished.

    This was a code that worked well for three years on many computers. Client changed to a new laptop and the code consistently fails for him. I can not reproduce the scenario on development/test machines with same configuration.

提交回复
热议问题