Difference between revisions of "$finddir"

From Scriptwiki
Jump to: navigation, search
 
m (Clarified N)
 
Line 5: Line 5:
 
* Dir is the directory to start the search in.
 
* Dir is the directory to start the search in.
 
* Wildcard is the wildcard matchtext to attempt to match against directory names.
 
* Wildcard is the wildcard matchtext to attempt to match against directory names.
* N is the number of directories to return. 0 for all possible.
+
* N is the number of matches to attempt to make. If N>0, the Nth file found matching the wildcard will be returned. If N=0 all possible matches are made and the number of matches is returned.
 
* Depth is the number of subdirectories deep to search. This is optional, and will be infinite unless specified.
 
* Depth is the number of subdirectories deep to search. This is optional, and will be infinite unless specified.
 
* @window is optional. If specified, it will print all directory results into the given window's listbox. The window '''must''' have a listbox.
 
* @window is optional. If specified, it will print all directory results into the given window's listbox. The window '''must''' have a listbox.

Latest revision as of 20:19, 10 May 2008

Searches the specified directory for directories matching the wild card given.

$finddir(dir,wildcard,N [,depth] [,@window | command])[ .shortfn ]
  • Dir is the directory to start the search in.
  • Wildcard is the wildcard matchtext to attempt to match against directory names.
  • N is the number of matches to attempt to make. If N>0, the Nth file found matching the wildcard will be returned. If N=0 all possible matches are made and the number of matches is returned.
  • Depth is the number of subdirectories deep to search. This is optional, and will be infinite unless specified.
  • @window is optional. If specified, it will print all directory results into the given window's listbox. The window must have a listbox.
  • Command is optional. If specified, it will perform a command for every possible match. $1- will be the directory found.
  • .shortfn is optional. If specified, it will return the short version of the path. See $shortfn for a brief explanation.

Example

alias listdirs { window -l @list | noop $finddir($disk(1).path,*,0,@list) }

See Also

$finddirn