This articlerelies excessively onreferences toprimary sources. Please improve this article by addingsecondary or tertiary sources. Find sources: "/dev/full" – news ·newspapers ·books ·scholar ·JSTOR(November 2016) (Learn how and when to remove this message) |
InLinux,FreeBSD, andNetBSD,/dev/full, or thealways-full device,[1][2] is aspecial file that always returns the error codeENOSPC (meaning "No space left on device") on writing, and provides any number of zero bytes to aprocess that reads from it (similar to/dev/zero).[3] This device is usually used when testing the behavior of a program when it encounters a "disk full" error.
$echo"Hello, World">/dev/fullbash: echo: write error: No space left on device
Support for the always-full device in Linux is documented as early as 2007.[2] Native support was added to FreeBSD in the 11.0 release in 2016,[4] which had previously supported it through an optional module called lindev.[4][5] The full device appeared inNetBSD 8.[6]
| Device | Read behavior[3] | Write behavior[3] | Use case |
|---|---|---|---|
| /dev/full | Returns zeros | Returns ENOSPC | Testing disk full errors |
| /dev/zero | Returns zeros | Discards data | Memory initialization |
| /dev/null | Returns EOF | Discards data | Suppressing output |