This help topic is for R version 0.90. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/Platform.html
Platform {base}R Documentation

Platform Specific Variables

Description

.Platform is a list with functions and variables as components. This provides a possibility to write OS portable R code. However, this interface is still somewhat experimental.

Currently, .Platform <- Platform() when R starts up. This is even more experimental.

Usage

.Platform
Platform()

Value

.Platform is list with at least the following components:

OS.type

character, giving the Operating Ssytem (family) of the computer.

file.sep

character, giving the file separator, used on your platform, e.g., "/" on Unix alikes.

dynlib.ext

character, giving the file name extension of dynamically loadable libraries, e.g., ".dll" on MS Windows.

See Also

system for invoking platform specific system commands.

Examples

if(.Platform$ OS.type == "Unix") {
   system.test <- function(...) { system(paste("test", ...)) == 0 }
   dir.exists <- function(dir) sapply(dir, function(d)system.test("-d", d))
   dir.exists(c(R.home(), "/tmp", "~", "/NO"))# > T T T F
}

[Package base version 0.90 ]