diff options
| author | JP Dillingham <jp@dillingham.me> | 2024-05-11 13:19:36 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2024-05-11 13:19:36 -0500 |
| commit | 28c2c7cbe76b215c605e1b510cee34270596cf27 (patch) | |
| tree | 5e4ddbe246130eb06241fcb73d82c9a37c77c88c /src | |
| parent | 6f652112800cc3de11c1ce0eaca3162b2179d02b (diff) | |
| download | slskd-28c2c7cbe76b215c605e1b510cee34270596cf27.tar.gz | |
stub creation logic
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) |
