CFILE                 package:RCurl                 R Documentation

_C_r_e_a_t_e _a _C-_l_e_v_e_l _h_a_n_d_l_e _f_o_r _a _f_i_l_e

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

     This function and class allow us to work with C-level 'FILE'
     handles. The intent is to be able to pass these to 'libcurl' as
     options so that it can read or write from or to the file. We can
     also do this with R connections and specify callback functions
     that manipulate these connections. But using the C-level FILE
     handle is likely to be significantly faster for large files.

_U_s_a_g_e:

     CFILE(filename, mode = "r")

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

filename: the name of the file on disk

    mode: a string specifying how to open the file, read or write, text
          or binary.

_D_e_t_a_i_l_s:

     This is a simple interface to the C routine 'fopen'.

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

     An object of class 'CFILE' which is  has a single slot name 'ref'
     which is an external pointer holding the address of the FILE
     object in C.

_A_u_t_h_o_r(_s):

     Duncan Temple Lang

_R_e_f_e_r_e_n_c_e_s:

     Man page for 'fopen'

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

     'curlPerform' and the 'readdata'

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

     ## Not run: 
     filename = system.file("tests", "amazon3.R", package = "RCurl")
     f = CFILE(filename)
     curlPerform(url = "http://s3.amazonaws.com/RRupload/duncan2",
                   upload = TRUE,
                   readdata = f@ref,
                   infilesize = file.info("tests/amazon3.R")[1, "size"])
     ## End(Not run)

