I got these working reasonably only on glibc. Portability problems occurred on Solaris, OSF/1, AIX, MacOS X, IRIX, HP-UX. If someone wants to continue, here's the code.
Bruno
freading.tar.gz
Description: application/tgz
fwriting.tar.gz
Description: application/tgz