basename
Get the base file name of a specified directory path.
basename returns the base filename of a specified full directory path. You can specify an optional systemtype parameter to identify the type of system the path represents. 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.
basename is also a method that can be called on an Endpoint object. In this case, the system type is taken from the Endpoint itself.
Usage
basename(path [,systemtype])
or
Server.basename(path)
Returns
String: The filename taken from the specified path.
Example
set res = basename("C:\temp\myfolder\myfile.txt,'windows'");
//
// res is myfile.txt
//
set res = basename('$2$DKA200:[FERDU01.TEST]vmsfile.txt','vms');
//
// res is vmsfile.txt
//
set unixserv = getserver('solaris1');
set res = ${unixserv.basename("/opt/myapp/mylib.so")};
// res is mylib.so
See Also
dirname()
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified August 31, 2024: Signed-off-by: tracyragan <[email protected]> (20379ca)