DirectoryName

DirectoryName["name"]
extracts the directory name from the specification for a file.

Details and OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Get the directory name of a file on Windows:

In[1]:=
Click for copyable input
Out[1]=

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

In[2]:=
Click for copyable input
Out[2]=

Apply DirectoryName two times:

In[3]:=
Click for copyable input
Out[3]=
Introduced in 1996
(3.0)
| Updated in 2008
(7.0)