[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] add option to set the offset of the archive
From: |
Matteo Croce |
Subject: |
Re: [PATCH 1/2] add option to set the offset of the archive |
Date: |
Thu, 24 Oct 2024 19:09:57 +0200 |
Il giorno gio 24 ott 2024 alle ore 18:56 Marius Spix
<marius.spix@web.de> ha scritto:
>
> Mhhhh,
>
> char *buf = xmalloc (offset_option);
> ...
> free (buf);
>
> Reading lots of data into a huge buffer just to free it later does not sound
> like a good idea. There are more efficient ways to fast-forward a tape or to
> receive a file stream starting at a certain offset (pipe dd through tar).
>
Hi,
yes, the buffer could be big. A better option could be to lseek(), but
that won't work with pipes.
Alternatively, I could create a decent sized buffer, e.g. a few Kb,
and read in a loop until needed.
I know that it's possible to pipe the stream with an external process,
but there are some use cases where a seekable file descriptor is
preferable.
One for all, listing the content of a huge archive is much faster when
tar can seek forward.
> Regards,
>
> Marius
>
>
>
Regards,
--
Matteo Croce
perl -e 'for($t=0;;$t++){print chr($t*($t>>8|$t>>13)&255)}' |aplay
- [PATCH 1/2] add option to set the offset of the archive, Matteo Croce, 2024/10/24
- [PATCH 2/2] add test for --offset, Matteo Croce, 2024/10/24
- Aw: [PATCH 1/2] add option to set the offset of the archive, Marius Spix, 2024/10/24
- Re: [PATCH 1/2] add option to set the offset of the archive,
Matteo Croce <=
- Re: [PATCH 1/2] add option to set the offset of the archive, Matteo Croce, 2024/10/24
- Re: [PATCH 1/2] add option to set the offset of the archive, Paul Eggert, 2024/10/25
- Re: [PATCH 1/2] add option to set the offset of the archive, Matteo Croce, 2024/10/25
- Re: [PATCH 1/2] add option to set the offset of the archive, Matteo Croce, 2024/10/30
- Re: [PATCH 1/2] add option to set the offset of the archive, Sergey Poznyakoff, 2024/10/31
- Re: [PATCH 1/2] add option to set the offset of the archive, Matteo Croce, 2024/10/31
- Re: [PATCH 1/2] add option to set the offset of the archive, Sergey Poznyakoff, 2024/10/31
- Re: [PATCH 1/2] add option to set the offset of the archive, Matteo Croce, 2024/10/31
- Re: [PATCH 1/2] add option to set the offset of the archive, Sergey Poznyakoff, 2024/10/31
- Re: [PATCH 1/2] add option to set the offset of the archive, Matteo Croce, 2024/10/31