mirror of https://github.com/Radarr/Radarr
Fixed: Only clear readonly flag when file has readonly flag
This commit is contained in:
parent
4752ba3341
commit
b47fa831ae
|
@ -401,8 +401,13 @@ namespace NzbDrone.Common.Disk
|
|||
{
|
||||
if (File.Exists(path))
|
||||
{
|
||||
var newAttributes = File.GetAttributes(path) & ~(FileAttributes.ReadOnly);
|
||||
File.SetAttributes(path, newAttributes);
|
||||
var attributes = File.GetAttributes(path);
|
||||
|
||||
if (attributes.HasFlag(FileAttributes.ReadOnly))
|
||||
{
|
||||
var newAttributes = attributes & ~(FileAttributes.ReadOnly);
|
||||
File.SetAttributes(path, newAttributes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue