|
|
Log in / Subscribe / Register

Fanotify and hierarchical storage management

Fanotify and hierarchical storage management

Posted Jun 23, 2023 15:28 UTC (Fri) by psusi (guest, #95157)
Parent article: Fanotify and hierarchical storage management

"He displayed an example command that would display the first few lines of a tar table of contents of a large file. Only the first 1MB of the file would be transferred before the command completed, rather than waiting for the entire contents. "

That isn't how tar works. It does not have a table of contents at the start of the file. zip and dar do, but with tar, every file metadata record is immediately followed by its data. To list the files in the tar, the entire tar file must be read.


to post comments

Fanotify and hierarchical storage management

Posted Jun 23, 2023 16:15 UTC (Fri) by jake (editor, #205) [Link]

> To list the files in the tar, the entire tar file must be read.

I don't know anything about the tar format, but the "demo" was to show the first few entries in the tar file. Given what you said about the format of tar, that would seem plausible from reading the first MB of the tar file (if the first few entries were contained in that chunk of the file).

jake

Fanotify and hierarchical storage management

Posted Jun 23, 2023 16:55 UTC (Fri) by farnz (subscriber, #17727) [Link]

The command didn't list all the files in the tar, though, just the first few. If I have thousands of small files in a tar, each under 4 KiB in size, then reading the first 1 MiB of the file is enough to list the first 256 files; if my command is `tar tf file.tar | head -n 3`, then I'm not going to read much more than 1 MiB before tar gets SIGPIPE from head, and shuts down.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds