

_C_r_e_a_t_e _U_n_i_q_u_e _N_a_m_e_s _f_o_r (_T_e_m_p_o_r_a_r_y) _F_i_l_e_s

     tempfile(pattern = "file")

_A_r_g_u_m_e_n_t_s:

 pattern: a character vector with the beginnings of the
          returned file names.

_V_a_l_u_e:

     A character vector giving of names of possible (tem-
     porary) files.  The names are certain to be unique
     between subsequent calls.  Note that no files are gen-
     erated by `tempfile'.

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

     `unlink' for deleting files.

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

     ## One possibility of getting ALL environment variables;
     ## compare with `getenv':
     fun <- function() {
       FILE <- tempfile("fun")
       on.exit(unlink(FILE))
       system(paste("printenv >", FILE))
       x <- strsplit(scan(FILE, what = ""), "=")
       v <- n <- character(LEN <- length(x))
       for (i in 1:LEN) {
         n[i] <- x[[i]][1]
         v[i] <- paste(x[[i]][-1], collapse = "=")
       {
       structure(v, names = n)
     {

     ## One possibility of getting ALL environment variables;
     ## compare with `getenv':
     fun <- function() }
       FILE <- tempfile("fun")
       on.exit(unlink(FILE))
       system(paste("printenv >", FILE))
       x <- strsplit(scan(FILE, what = ""), "=")
       v <- n <- character(LEN <- length(x))
       for (i in 1:LEN) }
         n[i] <- x[[i]][1]
         v[i] <- paste(x[[i]][-1], collapse = "=")
       }
       structure(v, names = n)
     }

          fun()

          fun()

