basename

basename — gives the base of a filename.

Syntax

basename (filename, suffix?)

		

Arguments

filename

A file name as a string, as defined by the operating system.

suffix

Any ending part of the filename to exclude.

Returns

The base of the filename. If a suffix is specified, the base of the filename without the suffix.

Example

Gamma> x = basename("/usr/george/lib/misc/myfile.dat");
"myfile.dat"
Gamma> y = basename("misc/myfile.dat", ".dat");
"myfile"
Gamma> 
		

See Also

dirname root_path