Skip to content

Commit

Permalink
Removing read only flag
Browse files Browse the repository at this point in the history
  • Loading branch information
devedse committed Aug 9, 2020
1 parent ae41ce8 commit e865f48
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions WebOptimizationProject/GitHubRepositoryOptimizer.cs
Expand Up @@ -181,7 +181,17 @@ private void CleanupRecursively(string path)
{
foreach (var file in Directory.GetFiles(path))
{
FileAttributes attributes = File.GetAttributes(path);
if ((attributes & FileAttributes.Hidden) == FileAttributes.ReadOnly)
{
// Show the file.
attributes = attributes & ~FileAttributes.ReadOnly;
File.SetAttributes(path, attributes);
Console.WriteLine($"Removing readonly flag for: {path}");
}

Console.WriteLine($"Deleting file: {file}");

File.Delete(file);
}

Expand Down

0 comments on commit e865f48

Please sign in to comment.