Wolfram Language & System 10.4 (2016)|Legacy Documentation
This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)
extracts the directory name from the specification for a file.
- DirectoryName works differently on different computer systems.
- DirectoryName["directory"] is normally equivalent to ParentDirectory["directory"].
- DirectoryName["name",n] applies DirectoryName n times to name.
- DirectoryName yields output appropriate for use in SetDirectory and FileNameJoin.
- If name contains no directory specification, DirectoryName["name"] returns .
- DirectoryName by default uses pathname separators and other conventions suitable for your operating system.
- DirectoryName[…,OperatingSystem->"os"] uses the conventions of the specified operating system. Possible choices are , , and .
Introduced in 1996
(3.0)| Updated in 2008