ExpandFileName
✖
ExpandFileName
textually expands name to have the form of an absolute file name for your operating system.
Details

- ExpandFileName["name"] interprets name relative to your current directory.
- ExpandFileName expands directory designations such as . and ...
- The result from ExpandFileName has the form of an absolute file name, with standard pathname separators appropriate for your operating system.
- ExpandFileName just operates on names of files; it does not actually search for the file specified.
- ExpandFileName[File["name"]] is also supported.
- ExpandFileName[URL["file:///path"]] converts a file-based URL to an absolute file name. »
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Convert the relative directory path to the full name:

https://wolfram.com/xid/0dqvlshkcl2-imux7y

https://wolfram.com/xid/0dqvlshkcl2-fxzrrp

Reset the directory to the previous directory:

https://wolfram.com/xid/0dqvlshkcl2-dk8ztt
Expand the file name specified by the File object:

https://wolfram.com/xid/0dqvlshkcl2-cly5pu

https://wolfram.com/xid/0dqvlshkcl2-bzvdwh

Reset the directory to the previous directory:

https://wolfram.com/xid/0dqvlshkcl2-5gvcqx
Scope (2)Survey of the scope of standard use cases
Applications (1)Sample problems that can be solved with this function
Properties & Relations (1)Properties of the function, and connections to other functions
ExpandFileName merely converts a relative path to a standard, absolute path:

https://wolfram.com/xid/0dqvlshkcl2-2sd1s5

AbsoluteFileName converts the name to an absolute path and verifies that the path exists:

https://wolfram.com/xid/0dqvlshkcl2-nhtogh


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