What is the correct way to interface with C for buffers (IOStream
)? Can I just pass the file descriptor using Base.fd
? (I don’t see any indications about this on either the IOStream
or the ccall
doc pages).
My example is even slightly more complicated than this: I am trying to write a wrapper for a C++ library in Julia, through a C interface. In particular, I need to wrap a C++ function which reads from a file (represented as a std::istream
parameter). On the C++ side i can build the std::istream
from a POSIX file descriptor (using boost). Will this cause problems with buffering?