DirectoryName

DirectoryName["name"]

extracts the directory name from the specification for a file.

Details and Options

Examples

open allclose all

Basic Examples  (1)

Get the directory name of a file on Windows:

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

Apply DirectoryName two times:

Scope  (1)

Get the directory name of a file specified as a File object:

Wolfram Research (1996), DirectoryName, Wolfram Language function, https://reference.wolfram.com/language/ref/DirectoryName.html (updated 2016).

Text

Wolfram Research (1996), DirectoryName, Wolfram Language function, https://reference.wolfram.com/language/ref/DirectoryName.html (updated 2016).

CMS

Wolfram Language. 1996. "DirectoryName." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/DirectoryName.html.

APA

Wolfram Language. (1996). DirectoryName. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DirectoryName.html

BibTeX

@misc{reference.wolfram_2024_directoryname, author="Wolfram Research", title="{DirectoryName}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/DirectoryName.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_directoryname, organization={Wolfram Research}, title={DirectoryName}, year={2016}, url={https://reference.wolfram.com/language/ref/DirectoryName.html}, note=[Accessed: 22-December-2024 ]}