Filename Completion |
|
Filename completion can help you by filling in a complete file name on the command line when you only remember or want to type part of it. Filename completion can be used at the command line, which is explained here, and in a filename completion window.
Filename Completion Keys:
| F8 or Shift-Tab | Get the previous matching filename. |
| F9 or Tab | Get the next matching filename. |
| F10 | Keep the current matching filename and display the next matching name immediately after the current one. |
| F12 | Repeat the filename just returned from an F9 / Tab match. |
| Ctrl-A | Toggle between long and short filename. |
Note: The keystrokes shown above are the default values. See Key Mapping Directives for details on how to assign different keystrokes.
For example, if you know the name of a file begins AU but you can't remember the rest of the name, type:
copy au
and then press the Tab key or F9 key. TCC will search the current directory for filenames that begin with AU and insert the first one onto the command line in place of the AU that you typed.
If this is the file that you want, simply complete the command. If TCC didn't find the file that you were looking for, press Tab or F9 again to substitute the next filename that match your pattern (in the above example, begins with AU). When there are no more filenames that match your pattern, the system will beep each time you press Tab or F9.
If you go past the filename that you want, press Shift-Tab or F8 to back up and return to the previous matching filename. After you back up to the first filename, the system will beep each time you press Shift-Tab or F8.
If you want to enter more than one matching filename on the same command line, press F10 when each desired name appears. This will keep that name and place the next matching filename after it on the command line. You can then use Tab (or F9) and Shift-Tab (or F8) to move through the remaining matching files.
The pattern you use for matching may contain any valid filename characters, as well as wildcard characters and extended wildcards. For example, you can copy the first matching .TXT file by typing
copy *.txt
and then pressing Tab.
If you don't specify part of a filename before pressing Tab, TCC will match all files. For example, if you enter the above command as "COPY ", without the *.TXT, and then press Tab, the first filename in the current directory is displayed. Each time you press Tab or F9 after that, another name from the current directory is displayed, until all filenames have been displayed. Note: you must terminate the command (e.g., by space) before file completion becomes available.
If you type a filename without an extension, TCC will append * to the name on LFN drives, and *.* on drives which only support short file names. It will also place a * after a partial extension. If you are typing a group of file names in an include list, the part of the include list at the cursor will be used as the pattern to match.
When filename completion is used at the start of the command line, it will only match directories, executable files, and files with executable extensions, since these are the only file names that it makes sense to use at the start of a command. If a directory is found, a \ will be appended to it to enable an automatic directory change. If you need to complete the name of any other file at the start of the command line, press Space before starting to type the name. Filename completion will then match any name, not just directory and executable names. Note that you can also "execute" files whose extension has an association in the Windows Registry, but such files are not considered executable by TCC, and only the method above using a space will work.
Filename completion occurs in the physical order in which matching filenames are stored in the directory, the same order in which DIR /O:U would list them. That order is determined by the underlying file system.
TCC also supports network server and sharename completion. If the filename begins with \\, the completion routines will enumerate the network resources for matching server and/or share names. You can control the way server name completion functions with the Server Completion configuration option.
Filename completion will search the PATH for an executable filename if you have set theSearch Path option in the Command Line configuration tab, and you are :
| (1) | at the beginning of the command line, and |
| (2) | there are no matching entries in the current directory, and |
| (3) | the name you are attempting to match doesn't contain a full or partial path specification. |
If all three conditions are met, filename completion will return the first matching executable found in the PATH.
If you are on an NTFS drive, you can also complete stream names. For example:
copy test:t
and then pressing Tab will search the file test for streams beginning with "t". Note that you cannot complete a filename and a stream name simultaneously (i.e., t*:t*).
Several topics are related to filename completion. See:
Converting Between Long and Short Filenames
Appending Backslashes to Directory Names
Customizing Filename Completion