I don't know if I'm clear in last message What I want to do is something like this, but i don't know if Rcpp can 'convert' the ifstream to SEXP and keep the object intact:
One RCPP function to open the file and return the "ifstream" object ifstream some_open_function(){ ifstream infile; infile.open("afile.dat"); return infile; } one read function: string read_file(ifstream infile){ string data; infile >> data; return data; } one close function: void close_file(ifstream infile){ infile.close(); }
_______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel