FileNameSplit
Details and Options

- FileNameSplit by default uses pathname separators and other conventions suitable for your operating system.
- FileNameSplit[…,OperatingSystem->"os"] uses the conventions of the specified operating system. Possible choices are "Windows", "MacOSX", and "Unix".
- Absolute file names that begin with a pathname separator yield a list of parts that starts with "".
- Under Windows, the drive or share name is treated as the first part of the file name.
- FileNameSplit just operates on names of files; it does not actually search for the file specified.
- FileNameSplit[File["name"]] is also supported.
- FileNameSplit[URL["file:///path"]] converts a file-based URL to a list of parts.
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (2)Survey of the scope of standard use cases
Split name of the file specified by the File object:
In[1]:=1

✖
https://wolfram.com/xid/0n4k1lnus00-y4wzs
Out[1]=1

In[2]:=2

✖
https://wolfram.com/xid/0n4k1lnus00-bzvdwh
Out[2]=2

Convert a file scheme URL to a list of parts:
In[1]:=1

✖
https://wolfram.com/xid/0n4k1lnus00-qi2a2j
Out[1]=1

In[2]:=2

✖
https://wolfram.com/xid/0n4k1lnus00-eo0yz0
Out[2]=2

Take the file name from a local object:
In[3]:=3

✖
https://wolfram.com/xid/0n4k1lnus00-7248pw
Out[3]=3

In[4]:=4

✖
https://wolfram.com/xid/0n4k1lnus00-muh9k6
Out[4]=4

Wolfram Research (2008), FileNameSplit, Wolfram Language function, https://reference.wolfram.com/language/ref/FileNameSplit.html (updated 2019).
✖
Wolfram Research (2008), FileNameSplit, Wolfram Language function, https://reference.wolfram.com/language/ref/FileNameSplit.html (updated 2019).
Text
Wolfram Research (2008), FileNameSplit, Wolfram Language function, https://reference.wolfram.com/language/ref/FileNameSplit.html (updated 2019).
✖
Wolfram Research (2008), FileNameSplit, Wolfram Language function, https://reference.wolfram.com/language/ref/FileNameSplit.html (updated 2019).
CMS
Wolfram Language. 2008. "FileNameSplit." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/FileNameSplit.html.
✖
Wolfram Language. 2008. "FileNameSplit." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/FileNameSplit.html.
APA
Wolfram Language. (2008). FileNameSplit. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FileNameSplit.html
✖
Wolfram Language. (2008). FileNameSplit. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FileNameSplit.html
BibTeX
✖
@misc{reference.wolfram_2025_filenamesplit, author="Wolfram Research", title="{FileNameSplit}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/FileNameSplit.html}", note=[Accessed: 25-March-2025
]}
BibLaTeX
✖
@online{reference.wolfram_2025_filenamesplit, organization={Wolfram Research}, title={FileNameSplit}, year={2019}, url={https://reference.wolfram.com/language/ref/FileNameSplit.html}, note=[Accessed: 25-March-2025
]}