/dev/fd might be more portable than /proc/self/fd; at least I'm sure the BSDs have it with 'fdescfs'. There is also the 'temp file' way - mkstemp() or /usr/bin/mktemp. -- Mantas Mikulėnas <grawity at gmail.com>