We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d393049 commit 71d8610Copy full SHA for 71d8610
+stdlib/os_version.m
@@ -7,12 +7,20 @@
7
8
function [os, version] = os_version()
9
10
-os = javaMethod("getProperty", "java.lang.System", "os.name");
11
-version = javaMethod("getProperty", "java.lang.System", "os.version");
+if stdlib.has_dotnet()
+ v = System.Environment.OSVersion.VersionString;
12
+ vs = split(string(v), ' ');
13
+ version = vs(end);
14
+ os = join(vs(1:end-1));
15
+else
16
+ os = javaMethod("getProperty", "java.lang.System", "os.name");
17
+ version = javaMethod("getProperty", "java.lang.System", "os.version");
18
+ try %#ok<*TRYNC>
19
+ os = string(os);
20
+ version = string(version);
21
+ end
22
+end
23
-try %#ok<*TRYNC>
- os = string(os);
- version = string(version);
24
end
25
26
%!test
0 commit comments