Skip to contents

The base function dirname may fail if the path passed is too long. This version checks if the call of dirname() failed and gives a clear error message.

Usage

directoryName(x)

Arguments

x

a file path of which to get the path to the directory only

Value

path to directory of file path given in x

Examples

if (FALSE) {
directoryName(repeated("verylongpath/", 50))
}