Site Tools


which_function

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

which_function [2007/03/02 02:32] (current)
Line 1: Line 1:
 +# $EPIC: which_function.txt,​v 1.3 2007/03/02 02:32:04 jnelson Exp $
 +======Synopsis:​======
 +$__which__(%%<​file>​%% [<​dir>​[:<​dir>​ ...]])
 +
 +======Technical:​======
 +The %%<​file>​%% argument is a [[what is a word|dword]],​ which is different
 +from most functions.
 +
 +This function returns the full pathname of the specified filename. ​ The
 +function will search the client'​s current [[set load path|LOAD_PATH]] for the
 +file.  In addition, a list of colon-delimited directories may be specified,
 +which will be searched if the file is not found in the [[set load
 +path|LOAD_PATH]].
 +
 +======Practical:​======
 +This function tries to find the location of a particular file.  This makes it
 +suitable for [[LOAD]] and [[STUB]] commands, allowing a file to be loaded, even
 +if its exact location is not known.
 +
 +======Returns:​======
 +the canonical path of the file, or nothing if it isn't found
 +
 +======Examples:​======
 +<​file>​
 +$which(some_file) ​          shows full path of file
 +$which(does_not_exist) ​     returns nothing, file dies not exist
 +$which(some_file /bin)      search in /bin for some_file too
 +</​file>​
  
which_function.txt ยท Last modified: 2007/03/02 02:32 (external edit)