Skip to content

Comment on A weird CPIO discrepancy

Comments

Probably the most authoritative current definition os cpio file format is description of pax utility in Single UNIX Specification, which states that "FIFO special files, directories, and the trailer shall be recorded with c_filesize equal to zero.".

What to do with CPIO archive that has non-zero c_filesize for directory is an interesting question. It seems to me that it is equally likely that such broken CPIO archive has c_filedata really empty and that it contains actual mostly meaningless data in there (most likely series of struct dirents in some format as returned by calling read(2) on directory).

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.