Posix (pax) tar uses extended headers to allow long filenames etc..

Is there a way to find out how many 512 byte blocks will be used for the header for a particular file (before actually running the tar command)

Am looking at implementing a byte range restore function from tape, so in order to get the exact bytes specified I need to know the offset from the beginning of the tar archive. Therefore I need to know how many blocks were used for the header (but without having to read them - since that will slow down the operation)

  • You should give a more detailed explanation about what you intend to do.Your current question is not precise enough to know whether star -c -v -block-number ... together with star -x -one-file mtskip=# ... would exactly match your requirement. See schilytools.sourceforge.net/man/man1/star.1.html – schily Oct 8 '20 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.