Directory Name

Get the directory name from a full directory path.

Returns the directory part of a full directory path, calculating the directory part of the string according to the optional systemtype parameter . If the systemtype is not specified then the system type is taken from the Endpoint currently on the stack. If no Endpoint is on the stack, an exception is thrown.

dirname is also a method that can be called on a Endpoint object. In this case, the system type is taken from the Endpoint itself.


dirname(path [,systemtype])




String: The directory part of the passed path.


set res = dirname("C:\temp\myfolder\myfile.txt, 'windows'");


// res is C:\temp\myfolder


set res = dirname('$2$DKA200:[FERDU01.TEST]vmsfile.txt', 'vms');


// res is $2$KDA200:[FERDU01.TEST]


See Also:


Last modified June 15, 2020: Remove extra headers in DMScript (102cb1a)