tai64n(8)

πŸ“¦
version 0.76 Β· 2 versions
  • 0.76 Β· debian bookworm, debian trixie, nixpkgs unstable, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.11 Β· alpine 3.24
, in debian bookworm, debian trixie, nixpkgs unstable, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸŽ€ NAME πŸŽ€

okay bestie, meet tai64n β€” she puts a precise timestamp on each line. that's it, that's the job. (it's tai64n(8), from the System Manager's Manual, if you're keeping receipts πŸ’–)


✨ SYNOPSIS ✨

tai64n

no flags, no args, no drama. she just runs. πŸ’…


🫢 DESCRIPTION 🫢

so here's the vibe: tai64n reads lines from stdin. and for each and every line it reads, it writes four things to stdout:

  1. an @,
  2. a precise timestamp,
  3. a space, and
  4. a copy of the input line.

and the timestamp? it marks the exact moment tai64n read the first character of that line. like, the first character. not the last. not when the line finished. the very first one. she's precise like that. ⏱️✨

and here's the lowkey iconic part: tai64n does not allocate any memory after it starts. not a single byte. she's already got everything she needs. main character with zero baggage, fr fr. 🧚


πŸ¦‹ TIMESTAMPS πŸ¦‹

the timestamps tai64n uses are 12-byte TAI64N labels in external TAI64N format, printed as 24 lowercase hexadecimal characters. lowercase!! we love a lowercase queen. πŸ’œ

and when you wanna read those timestamps like a human being instead of a hex goblin, you use tai64nlocal(8) to convert them to a human-readable format. iykyk. πŸŽ€

let's do the example, because it ate:

the timestamp 4000000037c219bf2ef02e94 refers to the nanosecond beginning exactly 935467455.787492500 seconds after the beginning of 1970 TAI; 37c219bf hexadecimal is 935467455, and 2ef02e94 hexadecimal is 787492500.

see how it splits?? the two halves of the hex are literally the two halves of the number. she's showing off and honestly? she should. πŸ”₯

now, the current implementation of tai64n relies on the UNIX gettimeofday library routine to return the current time as the number of TAI seconds since 1970-01-01 00:00:10 TAI. bestie, note that 00:00:10. ten seconds in. it's giving leap-second lore. πŸ™ˆ

⚠️ beware, okay? most gettimeofday implementations are not Y2038-compliant. and furthermore, most clocks are not set accurately. so like… the precision is real but the accuracy is on your system, not on her. not her fault. πŸ’€

🌈 EXIT CODES 🌈

  • tai64n exits 0 when it sees end of input. clean exit, no notes. ✨
  • it exits 111 without an error message if it has trouble reading stdin or writing stdout. silent queen, suffering quietly. 😭 no error message, just vibes and a 111.

πŸ‘‘ SEE ALSO πŸ‘‘

the whole daemontools family reunion, go say hi:

supervise(8), svc(8), svok(8), svstat(8), svscanboot(8), svscan(8), readproctitle(8), fghack(8), pgrphack(8), multilog(8), tai64nlocal(8), setuidgid(8), envuidgid(8), envdir(8), softlimit(8), setlock(8)

and the sacred link: http://cr.yp.to/daemontools.html


that's the whole page bestie 🫢 straight out of the System Manager's Manual, this is tai64n(8) β€” go timestamp something, you're gonna slay. πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from