4.2.9 dirname

string dirname(char *str)

The dirname function creates a string that consists of all but the last level of the pathname that is specified by str. The returned string is allocated out of scratch memory and is therefore valid only for the duration of the clause. If insufficient scratch memory is available, dirname does not execute and an error is generated.