If HAVE_FMEMOPEN is defined, the file format readers make use of fmemopen(). Example:
|
#if HAVE_FMEMOPEN == 1 |
|
file=fmemopen(RAW(pvfile), Rf_xlength(pvfile), "r"); |
|
#else |
|
file=fopen(CHAR(STRING_ELT(pvfile, 0)), "r"); |
|
#endif |
- Is this code correct at all? It seems to me that depending on this macro,
pvfile is interpreter either as the contents of a file, or a file name. These are not interchangeable.
- If this code is present, why are we not making use of
HAVE_FMEMOPEN?
This needs to be reviewed by someone familiar with R internals and R's facilities to treat strings as files. Can we make use of this and gain better performance when parsing contents of strings?
If
HAVE_FMEMOPENis defined, the file format readers make use offmemopen(). Example:rigraph/src/rinterface_extra.c
Lines 6423 to 6427 in 323f1b4
pvfileis interpreter either as the contents of a file, or a file name. These are not interchangeable.HAVE_FMEMOPEN?This needs to be reviewed by someone familiar with R internals and R's facilities to treat strings as files. Can we make use of this and gain better performance when parsing contents of strings?