CPIO

application/x-cpio

Safe

Magic Bytes

Offset: 0
30 37 30 37 30 37

The CPIO format is a general-purpose file archiver and container originally created by AT&T Bell Laboratories for the UNIX operating system. It is primarily utilized for creating tape backups, packaging RPM software distributions, and managing the initial RAM filesystem for modern Linux kernels. Although largely superseded by the TAR format for general user archiving, it remains a standard POSIX utility essential for specialized system-level distribution and boot processes.

Extension

.cpio

MIME Type

application/x-cpio

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .cpio files in Python

Python
def is_cpio(file_path: str) -> bool:
    """Check if file is a valid CPIO by magic bytes."""
    signature = bytes([0x30, 0x37, 0x30, 0x37, 0x30, 0x37])
    with open(file_path, "rb") as f:
        return f.read(6) == signature

How to validate .cpio files in Node.js

Node.js
function isCPIO(buffer: Buffer): boolean {
  const signature = Buffer.from([0x30, 0x37, 0x30, 0x37, 0x30, 0x37]);
  return buffer.subarray(0, 6).equals(signature);
}
Go
func IsCPIO(data []byte) bool {
    signature := []byte{0x30, 0x37, 0x30, 0x37, 0x30, 0x37}
    if len(data) < 6 {
        return false
    }
    return bytes.Equal(data[:6], signature)
}

API Endpoint

GET /api/v1/cpio
curl https://filesignature.org/api/v1/cpio

Related Formats