fileutil::paths(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

okay bestie, welcome to fileutil::paths(n) β€” she manages search path pools ✨ that's the whole vibe, that's the whole job, and she eats every time πŸ’…


✨ SYNOPSIS ✨

package require Tcl 8.5 9

package require fileutil::paths ?1.1?

::fileutil::paths poolName

poolName method ?arg arg ...?

poolName add path

poolName clear

poolName paths

poolName remove path

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically this gives you a snit class β€” and like, its instances? They manage a pool of (search) paths. That's it. That's the girl. She holds paths, she keeps them in order, she does not make it complicated 🫢


🌸 API 🌸

The main command is literally just how you build a search path pool, okay?

  • ::fileutil::paths poolName β€” creates a brand new, squeaky-clean, empty pool of search paths, and it comes with a global Tcl command attached whose name is poolName. You use that command to do literally every operation on the pool. The general shape of it is:
poolName method ?arg arg ...?

where method and its arguments decide the exact behavior of the command. iykyk.

Oh and !!! if you pass poolName as %AUTO%, the package will just generate a unique name for you itself, no thoughts required 🧚 The result of the command is the fully-qualified name of the instance command.

Then the pool objects themselves take these commands:

  • poolName add path β€” adds path to the pool. If the pool already knows that path? Nothing happens. Zero. Nada. No drama. The result of the command is the empty string.
  • poolName clear β€” wipes the entire pool, like, removes every single path from it πŸ’€ The result of the command is the empty string.
  • poolName paths β€” returns the list of all paths the pool knows about, in the exact order they were added πŸ‘‘ (order matters bestie, she remembers).
  • poolName remove path β€” removes path from the pool, but only if the pool actually knows it. Unknown paths? Ignored, no error, she's not gonna fight you about it πŸ™ˆ The result of the command is the empty string.

😭 BUGS, IDEAS, FEEDBACK 😭

ngl, this document and the package it describes will undoubtedly contain bugs and other problems. It's giving "we're all just doing our best." Please report them in the category fileutil of the Tcllib Trackers at http://core.tcl.tk/tcllib/reportlist 🫢 And please also send any ideas for enhancements you have for either the package and/or the documentation, we want them fr fr.

When you're proposing code changes, please provide unified diffs, i.e. the output of diff -u.

Also, heads up: attachments are strongly preferred over inlined patches. You can attach stuff by going to the Edit form of the ticket immediately after it's created, and then using the left-most button in the secondary navigation bar. It's giving scavenger hunt but it works πŸ’…


And that's the whole page, bestie πŸŽ€ this was fileutil::paths(n) from tcllib, version 1.1 β€” go forth and manage those pools, you absolute icon πŸŒˆπŸ’–

πŸ“¦ where this page comes from