in reply to Portable in-memory files

Update

I'm trying to use this with Compress::Zlib. Unfortunately, gzopen expects a real filehandle. It calls gzdopen on the file descriptor (returned by FILENO), a zlib-internal function written in C. I'm out of my wits.

*sigh*

In case anybody is wondering why I am doing this: I am trying to create in-memory .tar.gz files. Unfortunately, if I use memGzip to compress Archive::Tar's output, the resulting file cannot be read by some tar programs. I presume the reason is that memGzip only creates a minimal gzip file header.

Replies are listed 'Best First'.
Re: Re: Portable in-memory files
by bart (Canon) on Apr 07, 2003 at 00:17 UTC
    Archive::Tar has built-in support to gzip its output files for you. Just specify that compression is true. See the description for the methods "new", "read", and "write": the second argument must be true.

      Unfortunately, when looking at the source, I found out that the output is only compressed when going to a file. So that's not helpful for me.

        Wouldn't it be easiest to just patch Archive::Tar and be done with it, rather than going through such horrible contortions?

        Makeshifts last the longest.