This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / New in Version 3.0 / System Interface  /
DirectoryName

  • DirectoryName[" name "] extracts the directory name from the specification for a file.
  • DirectoryName works differently on different computer systems.
  • DirectoryName[" directory "] is equivalent to ParentDirectory[" directory "].
  • DirectoryName[" name ", n ] applies DirectoryName n times to name.
  • DirectoryName yields output appropriate for use in SetDirectory and ToFileName.
  • If name contains no directory specification, DirectoryName[" name "] returns "".
  • See the Mathematica book: Section 2.11.4.
  • See also: $Input, Directory.