$fname function

$fname(path)

The $fname function returns the file name of the passed-in path, i.e., the path section that starts after the last '\' or '/' separator in the path. If path is empty, the result is an empty string; if it doesn't contain any '\' or '/' separators, the result is a copy of path; if path ends with a '\' or '/' separator, the result is an empty string.

Parameters

All parameters may contain symbolic references; these are resolved before the function is applied. See Examples below.

path
File path from which to extract the file name.

Examples

Here are some usage examples for this function:

<$fname(C:\Program Files\InstallMate\Bin\Tin.exe)>
Returns Tin.exe from the literal path.
<$fname(<INSTALLDIR>\Bin\Tin.exe)>
Returns Tin.exe from the symbolic path, assuming that <INSTALLDIR> resolves to the appropriate folder path.
<$fname(<INSTALLDIR>\Bin)>
Returns Bin from the symbolic path, assuming that <INSTALLDIR> resolves to the appropriate folder path.
<$fname(<INSTALLDIR>\Bin\)>
Returns an empty string, assuming that <INSTALLDIR> resolves to the appropriate folder path.
<$fname(<#Tin_alias>)>
Returns Tin.exe from the file alias path, assuming that Tin_alias is the file alias for the Tin.exe executable.