# fileutil::paths(3tcl) 1.1 fileutil ""

## Name

fileutil::paths - Manage search path pools

## 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

Provides a snit class whose instances manage a pool of (search) paths.

## API

The main command provides construction of search path pools:

::fileutil::paths poolName

  Creates a new, empty pool of search paths with an associated global Tcl command whose name is poolName. It may be used to invoke various operations on the pool. It has the following general form:

  poolName method ?arg arg ...?

    method and arguments determine the exact behavior of the command.

  If poolName is specified as %AUTO% a unique name will be generated by the package itself. The result of the command is the fully-qualified name of the instance command.

The following commands are possible for pool objects:

poolName add path

  Adds the path to the pool. Nothing is done if the path is already known to the pool. The result of the command is the empty string.

poolName clear

  Clears the entire pool. In other words, removes all paths from it. The result of the command is the empty string.

poolName paths

  Returns the list of all paths known to the pool, in the order they were added.

poolName remove path

  Removes the path from the pool, if it is known to the pool. Unknown paths are ignored without error. The result of the command is the empty string.

## Bugs, Ideas, Feedback

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category fileutil of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.

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

Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar.