Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds build required OSPlatform calls #937

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions FileUploader/FileUpload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

using System.Net;
using System.Runtime.InteropServices;
using Minio;
using Minio.DataModel.Args;

Expand All @@ -32,7 +31,7 @@ public static class FileUpload
{
private static bool IsWindows()
{
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
return OperatingSystem.IsWindows();
}

private static async Task Main(string[] args)
Expand Down
3 changes: 1 addition & 2 deletions Minio.Examples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Net;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
using Minio.DataModel;
Expand Down Expand Up @@ -282,6 +281,6 @@ await SetBucketReplication.Run(minioClient, bucketName, destBucketName, replicat
File.Delete(smallFileName);
File.Delete(bigFileName);

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) _ = Console.ReadLine();
if (OperatingSystem.IsWindows()) _ = Console.ReadLine();
}
}
8 changes: 5 additions & 3 deletions Minio.Functional.Tests/FunctionalTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Net;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
Expand Down Expand Up @@ -4817,7 +4816,10 @@ internal static async Task GetObject_3_OffsetLength_Tests(IMinioClient minio)
#else
await File.WriteAllLinesAsync(tempSource, line).ConfigureAwait(false);
#endif
using (var filestream = File.Open(tempSource, FileMode.Open, FileAccess.Read, FileShare.Read))
FileStream filestream = null;
await
using ((filestream = File.Open(tempSource, FileMode.Open, FileAccess.Read, FileShare.Read))
.ConfigureAwait(false))
{
var objectSize = (int)filestream.Length;
var expectedFileSize = lengthToBeRead;
Expand All @@ -4826,7 +4828,7 @@ internal static async Task GetObject_3_OffsetLength_Tests(IMinioClient minio)
{
expectedFileSize = objectSize - offsetToStartFrom;
var noOfCtrlChars = 1;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) noOfCtrlChars = 2;
if (OperatingSystem.IsWindows()) noOfCtrlChars = 2;

expectedContent = string.Concat(line)
.Substring(offsetToStartFrom, expectedFileSize - noOfCtrlChars);
Expand Down