Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > String Manipulation > Operations on File Names > FileNameDepth >
Mathematica > Systems Interfaces & Deployment > File Operations > Operations on File Names > FileNameDepth >
Mathematica > Systems Interfaces & Deployment > File Operations > Directories & Directory Operations > Operations on File Names > FileNameDepth >

FileNameDepth

FileNameDepth
gives the number of path elements in the file name .
  • FileNameDepth by default assumes pathname separators and other conventions suitable for your operating system.
  • FileNameDepth just operates on names of files; it does not actually search for the file specified.
Find the number of path elements that make up a file name:
File name depths of some standard directories:
On Windows, the share name is treated as a single unit:
Find the number of path elements that make up a file name:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
File name depths of some standard directories:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
 
On Windows, the share name is treated as a single unit:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
New in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF