DirectoryName

DirectoryName["name"]

extracts the directory name from the specification for a file.

Details and Options

Examples

open allclose all

Basic Examples  (1)

Get the directory name of a file on Windows:

Get the directory name of a file on Mac OS X:

Apply DirectoryName two times:

Scope  (1)

Get the directory name of a file specified as a File object:

Introduced in 1996
 (3.0)
 |
Updated in 2008
 (7.0)
2016
 (11.0)