mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-19 22:04:56 -04:00
Fixed: Only clear readonly flag when file has readonly flag
This commit is contained in:
@@ -401,10 +401,15 @@ namespace NzbDrone.Common.Disk
|
||||
{
|
||||
if (File.Exists(path))
|
||||
{
|
||||
var newAttributes = File.GetAttributes(path) & ~(FileAttributes.ReadOnly);
|
||||
var attributes = File.GetAttributes(path);
|
||||
|
||||
if (attributes.HasFlag(FileAttributes.ReadOnly))
|
||||
{
|
||||
var newAttributes = attributes & ~(FileAttributes.ReadOnly);
|
||||
File.SetAttributes(path, newAttributes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public FileAttributes GetFileAttributes(string path)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user