is_windows Function

public function is_windows()

Try to determine if we run on Windows and don’t have POSIX compliance around

Arguments

None

Return Value logical

Operating system seems to be Windows


Source Code

function is_windows()

   !> Operating system seems to be Windows
   logical :: is_windows

   character(len=:), allocatable :: tmp

   is_windows = .false.
   call get_variable('OS', tmp)
   if (allocated(tmp)) then
      is_windows = index(tmp, 'Windows_NT') > 0
   end if
   if (.not.is_windows) then
      call get_variable('OSTYPE', tmp)
      if (allocated(tmp)) then
         is_windows = index(tmp, 'win') > 0 .or. index(tmp, 'msys') > 0
      end if
   end if

end function is_windows