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)
I've had problems with this before, but this is not specific to SSD drives. You would be far better off doing a move then delete:
if(Directory.Exists(dirpath))
{
string temppath = dirpath + ".deleted";
Directory.Move(dirpath, temppath);
Directory.Delete(temppath, true);
}
Directory.Create(dirpath);
The other way to deal with it is to loop until complete:
if(Directory.Exists(dirpath))
{
Directory.Delete(dirpath, true);
int limit = 100;
while(Directory.Exists(dirpath) && limit-- > 0)
Thread.Sleep(0);
}
Directory.Create(dirpath);