$finddir » History » Version 3
Per Amundsen, 08/12/2015 12:43 PM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | *$finddir(dir,wildcard,N,[depth],[@window|command])* |
||
4 | |||
5 | Searches the specified directory and its sub directories for the Nth directory name matching the wildcard specification and returns the full path and directory if it is found. |
||
6 | |||
7 | *Parameters* |
||
8 | |||
9 | dir - The directory to search. |
||
10 | wildcard - Wildcard to search for. |
||
11 | 2 | Per Amundsen | N - If N = 0, number of directories, otherwise the Nth directory. |
12 | 1 | Per Amundsen | [depth] - Maximum folder depth. (optional) |
13 | [@window|command] - Custom window name or a command. (optional) |
||
14 | |||
15 | *Properties* |
||
16 | |||
17 | .shortfn - Return the path in a [[$shortfn|shortfn]] format. |
||
18 | 2 | Per Amundsen | |
19 | *Example* |
||
20 | |||
21 | <pre> |
||
22 | ; Print number of sub directories found in $adiircdir. |
||
23 | 3 | Per Amundsen | //noop $finddir($adiircdir,*.*,0,echo -ag $1-) |
24 | 2 | Per Amundsen | |
25 | 1 | Per Amundsen | ; Print all sub directories in $adiircdir, when using the command parameter, $1- will hold the path. |
26 | 3 | Per Amundsen | //noop $finddir($adiircdir,*.*,0,echo -ag $1-) |
27 | |||
28 | ; Print the 1st directory found. |
||
29 | //echo -ag $finddir($adiircdir,*.*,1) |
||
30 | 2 | Per Amundsen | </pre> |