writebuffer(1)

πŸ’Ύ writebuffer β€” the manual page, but make it cute

okay bestie, welcome to writebuffer(1) ✨ it's a little program from the General Commands Manual and honestly? it's giving patient queen. it does one thing and it does it slayfully.


🌸 NAME 🌸

writebuffer β€” write output to devices which don't like constant stopping and starting 🫢

like fr, some devices are sensitive and you gotta be gentle with them.


✨ SYNOPSIS ✨

writebuffer [--mlock] [size]

that's it. that's the whole vibe. one optional flag, one optional size, and a whole lot of buffering πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie πŸ“: writebuffer reads data on standard input and writes it to standard output.

but β€” and this is the main character moment β€” it does NOT just yeet every little bit straight through. nope. it buffers internally up to size megabytes, and it will only write data when:

  • the buffer is at least 75% full 🌈, OR
  • there is no more input to fill the buffer 😭

periodt. that's the whole algorithm. it waits, it accumulates, it releases at the right time. discipline. iconic.


and now the cute part: size may also be suffixed with m, k, or b to indicate that it is in:

  • megabytes (2^20) β€” that's the m bestie
  • kilobytes (2^10) β€” that's the k
  • bytes β€” that's the b, no maths required, just raw little guys πŸ’€

so you can say what you mean and the numbers stay exactly the numbers they are. no vibes-based rounding here, we're being precise ✨


πŸ’‘ why does this exist tho

it is intended for use in situations where many small writes are undesirable for performance reasons, e.g. tape drives πŸ“Ό

like, imagine asking a tape drive to stop and start a thousand times a second. the AUDACITY. she would simply pass away. so instead you let writebuffer collect everything up and hand it over in one big gorgeous chunk. respectful. considerate. wife material. πŸ‘‘


πŸ’… OPTIONS πŸ’…

  • --mlock β€” calls mlock(2) to lock the buffer into memory πŸ”’

that's it, that's the only flag, and she's thriving. no cap. if you want your buffer pinned in memory and not going anywhere, this is your girl 🫢


πŸ‘€ SEE ALSO πŸ‘€

  • readbuffer(1) β€” the other half of the friendship duo πŸ«‚
  • mlock(2) β€” the syscall that --mlock is out here calling πŸ’«

πŸŽ€ reminder bestie: the description says writes happen at 75% full or when there's no more input. not before. not whenever it feels like it. she's consistent and we love that for her.

and that's the whole page, bestie πŸ’– this was the chiark-backup era, dated 2001-10-21 β€” so yeah, she's an elder icon, been slaying since before some of us were born 😭🌸 ily, go buffer something responsibly βœ¨πŸ¦‹