R/get_operating_system.R

Defines functions get_os

Documented in get_os

#' Get operating system
#'
#' \code{get_os} gets the operating system.
#' @return
#' A string with the operating system.
#' @export
get_os <- function(){
  sysinf <- Sys.info()
  if (!is.null(sysinf)){
    os <- sysinf['sysname']
    if (os == 'Darwin')
      os <- "MacOSX"
  } else { ## mystery machine
    os <- .Platform$OS.type
    if (grepl("^darwin", R.version$os))
      os <- "osx"
    if (grepl("linux-gnu", R.version$os))
      os <- "linux"
  }
  tolower(os)
}
DARTH-git/darthtools documentation built on April 3, 2025, 2:12 p.m.