[File] Help implementing "octal" indirect offset support
Christos Zoulas
christos at zoulas.com
Fri Sep 9 15:11:09 UTC 2022
Yes, that's right ID3 is the closest thing we have for now. But you don't need
to do deal with them as quad types since the union also contains a string.
You can parse the value from the string directly I think.
Best,
christos
> On Sep 9, 2022, at 10:42 AM, Michał Górny <mgorny at gentoo.org> wrote:
>
> Hi,
>
> I'd like to implement support for reading octal numbers like these used
> in the ustar format and using them as indirect offsets. This would
> permit the GPKG magic to obtain the length of a tar archive member
> and use it to locate the record for the second member. However, after
> staring at the existing code for an hour or so I don't seem to be able
> to figure out how to do that.
>
> FWICS the closest thing file(1) currently supports are *id3 types. IIUC
> the code just reads them as 32-bit integer and then transforms them
> as appropriate. I suppose I could try implementing something similar
> on top of *quad types to be able to read up to 8 octal digits.
>
> I suppose this would be good enough for my use case but I'm wondering if
> you can think of a better way of implementing this. TIA.
>
> --
> Best regards,
> Michał Górny
>
> --
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <https://mailman.astron.com/pipermail/file/attachments/20220909/61d94376/attachment.asc>
More information about the File
mailing list