DIRNAME        Retrieve the directory part of a path

<< Click to Display Table of Contents >>

Navigation:  Robo-FTP User's Guide > Script Programming > Script Commands > All Script Commands >

DIRNAME        Retrieve the directory part of a path

Syntax:

DIRNAME

[ 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 directory by itself into the specified variable.

 

For example, given absolute path "C:\sub\dir\file.txt", to extract the "C:\sub\dir" part of the path and store in variable mydir, use:

 

DIRNAME mydir = "C:\sub\dir\file.txt"

 

Related command(s): BASENAME