IT lexicon › Infra & Ops › Hole in file

Hole in file

Infra & Ops På svenska → Updated: 2026-11-17

A region within a file that has no actual disk space allocated and reads as zeros without consuming storage.

A hole appears when a program writes to a distant offset without filling the intermediate space — often to create a sparse file. Instead of allocating blocks for all that zero-filled space, the filesystem merely records that the region is unallocated. When a read occurs in the hole, the filesystem automatically returns zeros without touching disk.

This optimization saves dramatic storage in applications working with sparse matrices, virtual disk images, or logfiles with long dead periods. A hole uses negligible storage yet counts toward the file's logical size. Tools like seek and lseek let programs create holes explicitly.

← Back to the lexicon