

Platform {base}                              R Documentation

_P_l_a_t_f_o_r_m _S_p_e_c_i_f_i_c _V_a_r_i_a_b_l_e_s

_D_e_s_c_r_i_p_t_i_o_n_:

     `.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.

_U_s_a_g_e_:

     .Platform
     Platform()

_V_a_l_u_e_:

     `.Platform' is list with at least the following compo-
     nents:

 OS.type: character, giving the Operating System (family) of
          the computer.  One of the following values is
          returned: `"unix"',  `"mac"', or  `"windows"' (in
          historical order).

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
          Windows.

_S_e_e _A_l_s_o_:

     `system' for invoking platform specific system com-
     mands.

_E_x_a_m_p_l_e_s_:

     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
     }

