Exemple #1
0
        public static void RecursiveDelete(string path)
        {
            DirectoryInfo directory = new DirectoryInfo(path);

            foreach (FileInfo file in directory.GetFiles())
            {
                file.Attributes = FileAttributes.Normal;

                RetryOnException(() => file.Delete());
            }

            foreach (DirectoryInfo subDirectory in directory.GetDirectories())
            {
                SystemIORunner.RecursiveDelete(subDirectory.FullName);
            }

            RetryOnException(() => directory.Delete());
        }
Exemple #2
0
 public override string DeleteDirectory(string path)
 {
     SystemIORunner.RecursiveDelete(path);
     return(string.Empty);
 }