tag(3tcl)

πŸ“¦
version 0.2.6 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

🌸 tag β€” bestie edition 🌸

okay so this is tag, and it lives in the Tcl manual pages (section 3, for the library/procedure girlies πŸ’…). it's all about manipulating tagged files and honestly? it eats. let's get into it 🫢


✨ NAME ✨

tag β€” manipulate tagged files. that's the whole vibe. tagged files, we move them, we read them, we write them. iconic.


✨ SYNOPSIS ✨

tag option ?arg arg ...?

✨ DESCRIPTION ✨

the tag procedure is literally just a lil bundle of options for messing with tagged files. you call it, you give it an option, you give it some args, it does the thing. no cap ✨


✨ COMMANDS ✨

  • tag readfile filename β€” reads the file at the given filename and hands you back a list. every element of that list is one tag record, and each tag record is itself a list of label-value pairs, or label-value-endlabel triples. and listen β€” the tag header is the very first element it returns. first. the main character. πŸ‘‘
  • tag writefile filename list β€” takes a list in the format that tcl programs use internally for tagged data, and writes it out as a tagged file at filename. basically the reverse of readfile, and she ate πŸ’–
  • tag extract list tests β€” takes a list in tagged format plus a list of conditions, and returns a new list in tagged format containing only those tag records that match the conditions. filtering? we love her. πŸŽ€

the tests argument is a list of test items, and each test item is a list shaped like this:

{ labelname condition matchvalue }

and the conditions you can use are… drumroll pls πŸ₯

  • == β€” string equals. they're the same string, periodt.
  • != β€” string not equal. they are NOT the same string, and we're saying it out loud.
  • <= β€” less than or equal. tiny or exactly the same, either way she's valid.
  • -in β€” is the test value a member of the list given as the matchvalue? like, is she in the group chat? πŸ’¬
  • -contains β€” does the match value contain the test value as a case insensitive substring? so casing? doesn't matter. not even a little. πŸ™ˆ
  • -earlier β€” date earlier. comparing dates, bestie.
  • -later β€” date later. and jsyk, dates here are in ISO format: yyyy-mm-dd [hh:mm:ss]. note the time part is optional, iykyk ⭐
  • -exists β€” does the label exist in this record? yes or no, that's the whole question. simple. clean. 🌸

πŸ’€ BUGS πŸ’€

okay so we gotta be honest here, no gatekeeping:

tag readfile reads the whole file into memory before turning it into a list. so yeah. it should be more memory efficient. she's a lil hungry. 😭
the -earlier and -later comparisons require TCL8.3. so if you're on something older, those two are just not gonna show up for you. sorry bestie 🫢

πŸ‘‘ AUTHOR πŸ‘‘

John Lines (john+taglog@paladyn.org) β€” thank you for your service, king 🫑✨


and that's the whole page, fr fr πŸ’– this one's from the tcl manual, tag(3tcl) section, dated July 3, 2000 β€” a classic, an absolute vintage icon, we stan. go manipulate some tagged files, bestie, you got this πŸŒˆπŸŽ€πŸ’…

πŸ“¦ where this page comes from