/* ANY-LICENSE V1.0 ---------------- You can use these files under any license approved by the Open Source Initiative, preferrably one of the popular licenses, as long as the license you choose is compatible to the dependencies of these files. See http://www.opensource.org/licenses/ for a list of approved licenses. Author: Martin Furter Project: borgnet, borg.ch C# classes and examples. Modified: 2019 Support for atomically replacing an existing file. */ using System; using System.IO; using System.Runtime.InteropServices; namespace BorgCh.Hacks { public class OsType { public static bool is_unix() { OperatingSystem os = Environment.OSVersion; PlatformID pid = os.Platform; return pid == PlatformID.Unix; } public static bool is_windows() { OperatingSystem os = Environment.OSVersion; PlatformID pid = os.Platform; switch( pid ) { case PlatformID.Win32NT: case PlatformID.Win32S: case PlatformID.Win32Windows: case PlatformID.WinCE: return true; default: return false; } } } } // namespace borg_ch.hacks