PrintableCharts

THE FLAGS OF OPEN()

FIVE flags of creating a file — and why O_CREAT|O_EXCL is not a faster check but a check and a creation joined into one indivisible act

Built as a memo rather than a table: the thing worth hanging it up for reads across the room, with the full reference in smaller type below it.

Three sizes in one archive — from a sheet on the fridge to a poster on the wall.

Free

By downloading you agree to the Terms.

Formats
A4 · A3 · A2
What you get
Print-ready PDFs, one per size, with every letterform converted to outlines — nothing to install, nothing to shift.
Subject
code · everyone · memo · study

On the left, a path with a separate check and a gap between its steps; on the right, one act with no gap. Below, the same five flags verbatim from the standard and six outcomes checked by the file system.

O_APPEND: TWO WRITERS IN TURN, NEITHER OVERWRITES THE OTHER

POSIX says of O_APPEND: "the file offset shall be set to the end of the file prior to each write and no intervening file modification operation shall occur between changing the file offset and the write operation" — so two descriptors that append to the same file in turn never overwrite each other.

Of the call itself the standard concedes it "does not specify the behavior of concurrent writes to a regular file from multiple threads, except that each write is atomic" — only a single write() is atomic; without O_APPEND, where it lands depends on a stale offset computed in advance, and that is exactly what overwrites the other write.

On the sheet

  • On the left, a path with a separate check and a gap between its steps; on the right, one act with no gap. Below, the same five flags verbatim from the standard and six outcomes checked by the file system.
  • Colour carries meaning, but meaning never rests on colour alone — the sheet reads in black and white.
  • Nothing about how it was made: the sheet carries only what the reader needs.

Printing

  • Three sizes in the archive: A4 — 210×297 mm, A3 — 297×420 mm, A2 — 420×594 mm.
  • All text is converted to outlines. No fonts to install, and nothing shifts on another machine.
  • White background and sparing fills — it prints on a home printer without draining the cartridge.
  • Margins of at least 10 mm: a home printer cannot print to the edge.
  • No stroke thinner than 0.3 mm, so nothing disappears in print.

Why the numbers can be trusted. Every countable number here is computed from data rather than typed in, and the sheet must pass 7 independent checks before it is allowed to build — how many items there are, the order they come in, and the claim in the highlighted box itself. If one fails, there is no file.

More like this