dirname

Returns the directory name from a path name. (version 4.69 or later)

dirname <strvar> <path>

Remarks

Given a <path> pathname, this macro will delete any suffix beginning with the last slash('/') character and return the result into the <strvar> variable name.
The pathname will need not be existed.

Example

dirname dir 'c:\teraterm\test.txt'
; dir = "c:\teraterm"
dirname dir 'c:\teraterm\'
; dir = "c:"
dirname dir 'c:\teraterm'
; dir = "c:"

See also