I am progressing reasonably well on reading the ASCII version of the R save format (see
https://github.com/dmbates/RDA.jl) and now, in a moment of madness, plan to try reading the binary format. It mostly comes down to Int32 and Float64 values stored in XDR format (bigendian) within a file that is usually compressed with gzip or xz compression.
Assuming that I have a gzip'd file, I can use the GZip module (extras/gzip.jl) to open it an pull bytes from it. What I would like to do is to create an XDR structure (defined in /usr/include/rpc/xdr.h) with that stream and use the
xdr_<whatever>
functions to read the contents. Is this going about things in a reasonable way? If so, some hints on how I would accomplish this would be welcome. (For example, in what shared object are the xdr library routines found?) If not, what alternatives would be good?
By the way, reading can be done in a single pass so I don't ever need to seek in the file.