git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Management of opendocument (openoffice.org) files in git

From
Avery Pennarun <apenwarr@gmail.com>
Date
Sep 16, 2008, 16:04 UTC
Message-ID
<32541b130809160904v7acc73cfm4856c33d40555e94@mail.gmail.com>
In-Reply-To
<48CF630F.4090808@gmail.com>

On Tue, Sep 16, 2008 at 3:41 AM, Sergio Callegari <sergio.callegari@gmail.com> wrote:

Show 12 quoted lines
> Johannes Sixt wrote:
>>
>> You don't need a temporay zip filename in filter mode:
>>
>>  unzip $UNZIP_OPTS /dev/stdin  # works for me, but not 100% portable
>>  zip $ZIP_OPTS - .             # writes to stdout
>>
>>
>
> The unzip documentation says "Archives read from standard input are not yet
> supported", so I was a bit worried about using the /dev/stdin thing.  Might
> it be that there are subtle cases where unzip needs to seek or rewind?

IIRC zip files keep their index at the end of the file, which means zipping in a pipeline is efficient (you can write all the blocks first, then drop the final index at the end) but unzipping that way is really hard.

unzipping from /dev/stdin seems to work if stdin is seekable, otherwise not.
       unzip /dev/stdin <filename.zip    # works
       cat filename.zip | unzip /dev/stdin    # doesn't work
Have fun,
Avery
Previous: Johannes SixtNext: Stephen R. van den Berg
Message 7 of 10 in “Management of opendocument (openoffice.org) files in git”
  1. Sergio CallegariSep 15, 2008
  2. Matthieu MoySep 16, 2008
  3. Sergio CallegariSep 16, 2008
  4. Johannes SixtSep 16, 2008
  5. Sergio CallegariSep 16, 2008
  6. Johannes SixtSep 16, 2008
  7. Avery PennarunSep 16, 2008
  8. Stephen R. van den BergSep 16, 2008
  9. Robin RosenbergSep 16, 2008
  10. Peter KreftingSep 23, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.