diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Transfers/Downloads/DownloadService.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs index 57a78a1f..a8269b49 100644 --- a/src/slskd/Transfers/Downloads/DownloadService.cs +++ b/src/slskd/Transfers/Downloads/DownloadService.cs @@ -598,7 +598,18 @@ namespace slskd.Transfers.Downloads Directory.CreateDirectory(path); } - return new FileStream(localFilename, FileMode.Create); + var options = new FileStreamOptions + { + Mode = FileMode.Create, + Access = FileAccess.Write, + }; + + if (!OperatingSystem.IsWindows()) + { + options.UnixCreateMode = UnixFileMode.GroupExecute | UnixFileMode.GroupRead | UnixFileMode.UserRead | UnixFileMode.UserExecute; + } + + return new FileStream(localFilename, options); } private static string MoveFile(string filename, string sourceDirectory, string destinationDirectory) |
