source/R5T.Magyar/Code/IO/Helpers/DirectoryHelper.cs
/// <summary>
/// Remove the read-only attribute from all files.
/// </summary>
/// <remarks>
/// Adapted from: https://stackoverflow.com/questions/1982209/cannot-programatically-delete-svn-working-copy
/// </remarks>
Remove the read-only attribute from all files.
Remove the read - only attribute from all files .
public static void DisableReadOnly(DirectoryInfo directoryInfo)
        {
            foreach (var file in directoryInfo.GetFiles())
            {
                if (file.IsReadOnly)
                {
                    file.IsReadOnly = false;
                }
            }
            foreach (var subdirectory in directoryInfo.GetDirectories())
            {
                DirectoryHelper.DisableReadOnly(subdirectory);
            }
        }
public static void DisableReadOnly ( DirectoryInfo directoryInfo ) { foreach ( var file in directoryInfo . GetFiles ( ) ) { if ( file . IsReadOnly ) { file . IsReadOnly = false ; } } foreach ( var subdirectory in directoryInfo . GetDirectories ( ) ) { DirectoryHelper . DisableReadOnly ( subdirectory ) ; } }
Remove the read-only attribute from all files.
Remove the read - only attribute from all files .
directoryInfo
DirectoryInfo
remarks
None