guard against InheritFolderPermissionsNotImplementedException in linux.

This commit is contained in:
kay.one 2013-09-14 17:08:16 -07:00
parent f8afed195a
commit 873134fcee
1 changed files with 13 additions and 3 deletions

View File

@ -271,10 +271,20 @@ namespace NzbDrone.Common
{
Ensure.That(() => filename).IsValidPath();
try
{
var fs = File.GetAccessControl(filename);
fs.SetAccessRuleProtection(false, false);
File.SetAccessControl(filename, fs);
}
catch (NotImplementedException)
{
if (!OsInfo.IsLinux)
{
throw;
}
}
}
public long? GetAvailableSpace(string path)
{