BASENAME Retrieve the file part of a path
<< Click to Display Table of Contents >> Navigation: Robo-FTP User's Guide > Script Programming > Script Commands > All Script Commands > BASENAME Retrieve the file part of a path |
Syntax: |
BASENAME |
[ variable ] = [ path ] |
Arguments: |
[ variable ] |
Variable in which to store the result. |
|
[ path ] |
Variable or string containing the path to a file. Can be a relative or absolute path. |
This command takes an absolute or relative path to a file and puts the filename by itself into the specified variable.
For example, given absolute path "C:\sub\dir\file.txt", to extract the "file.txt" part of the path and store in variable myfile, use:
BASENAME myfile = "C:\sub\dir\file.txt"
Related command(s): DIRNAME