Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not seek in input: Illegal seek #62

Open
radeletp opened this issue Apr 18, 2016 · 7 comments
Open

can not seek in input: Illegal seek #62

radeletp opened this issue Apr 18, 2016 · 7 comments

Comments

@radeletp
Copy link

radeletp commented Apr 18, 2016

When trying to use pixz with clonezilla to check image, the following command is executed:

cat /home/partimag/cust/sdb2.ext4-ptcl-img.xz.aa |
pixz -d |
LC_ALL=C partclone.chkimg -N -s -

Using stream show following stderr which is not really user friendly and might make thing to the user that the integrity of the file is not OK:

"can not seek in input: Illegal seek"

Seems this warning is provided by decode_index function, anyway there is no failure and pixz is correctly behaving even when the input file is stream. Is it possible to remove this warning information from decode_index function?

@ole-tange
Copy link

ole-tange commented Aug 1, 2016

Can also be reproduced with:

echo | pixz | pixz -d | wc

@wookietreiber
Copy link
Collaborator

wookietreiber commented Aug 1, 2016

Thanks for reporting. I am not yet well versed with the internals, @vasi can you shed some light on this?

@vasi
Copy link
Owner

vasi commented Aug 1, 2016

Pixz can decompress fine without an index. The only potential problems I can think of are:

  • Some tools might create pixz files with multiple blocks, where the blocks headers don't include a size. In that case, pixz won't be able to do parallel decompression, things will slow down.
  • Someone might try to use the "-x" option to pixz, to filter the list of files. That won't work if there's no index.

We should probably turn this message into a warning?

@wookietreiber
Copy link
Collaborator

I guess, we could implement a switch that checks early if we are working with a stream or a plain file, then branch off to one section that handles streams and one that handles files. This way, we can capture what capabilities are possible and issue warnings/errors appropriately depending on what the user wants.

@ole-tange
Copy link

This issue blocks pixz to be used as a dropin replacement for gzip (sort --compress-program=pixz / tar --use-compress-program pixz / parallel --compress-program pixz).

@mgheorghe
Copy link

any update on this ?
i'm keep getting
partclone.c,open_target,1611: open /dev/sda1 error(17)

@jorismak
Copy link

jorismak commented Jun 16, 2022

Maybe I'm missing how this is supposed to be used,
But i did pixz backup.tar backup.tpxz and it compressed the raw tarball.
If I do pixz -l backup.tpxz I get a fast and nice listing of all the files in the tarball.
But if I do pixz -x /some/file/from/listing backup.tpxz I get this same message 'illegal seek' and it appears to just sit there doing nothing? (Or it takes a long time because the entire archive has to be decompressed anyway because of the illegal seek?).

If I managed to create a tpxz file without an index

  • How do I create one with an index?
  • Why is the file listing so quick?

EDIT: Found it, I had my -x command line wrong. You need to pipe in the .tpxz file with -x, and it outputs a little blob of tar you need to feed into a tar xpP style commandline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants