diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-10-04 14:52:50 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-04 14:52:50 -0400 |
| commit | 185fa7f5e76a9971e34c35783698d37902ed14cb (patch) | |
| tree | a840cff09050c5c76645596bfd99bb5dfd5ad4a0 /Emby.Server.Implementations/IO/ManagedFileSystem.cs | |
| parent | c67f03ee97019aff0af41e8c6f4f8525ef90b5e5 (diff) | |
| parent | 1caae368d5f75d96dada65cd2175831982363c21 (diff) | |
Merge pull request #2941 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/IO/ManagedFileSystem.cs')
| -rw-r--r-- | Emby.Server.Implementations/IO/ManagedFileSystem.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.cs index 0d85a977c..125d9e980 100644 --- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs +++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using System.Text; @@ -24,12 +25,14 @@ namespace Emby.Server.Implementations.IO private string _tempPath; private SharpCifsFileSystem _sharpCifsFileSystem; + private IEnvironmentInfo _environmentInfo; public ManagedFileSystem(ILogger logger, IEnvironmentInfo environmentInfo, string tempPath) { Logger = logger; _supportsAsyncFileStreams = true; _tempPath = tempPath; + _environmentInfo = environmentInfo; // On Linux, this needs to be true or symbolic links are ignored EnableFileSystemRequestConcat = environmentInfo.OperatingSystem != MediaBrowser.Model.System.OperatingSystem.Windows && @@ -1051,7 +1054,25 @@ namespace Emby.Server.Implementations.IO public virtual void SetExecutable(string path) { + if (_environmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.OSX) + { + RunProcess("chmod", "+x \"" + path + "\"", GetDirectoryName(path)); + } + } + private void RunProcess(string path, string args, string workingDirectory) + { + using (var process = Process.Start(new ProcessStartInfo + { + Arguments = args, + FileName = path, + CreateNoWindow = true, + WorkingDirectory = workingDirectory, + WindowStyle = ProcessWindowStyle.Normal + })) + { + process.WaitForExit(); + } } } } |
