WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center

FileBaseName ["file"]

gives the base name for a file without its extension.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Possible Issues  
See Also
Related Guides
Related Workflows
History
Cite this Page

FileBaseName ["file"]

gives the base name for a file without its extension.

Details and Options

  • FileBaseName ["name.ext"] gives "name".
  • FileBaseName drops all directory specifications.
  • FileBaseName by default assumes pathname separators and other conventions suitable for your operating system.
  • FileBaseName [,OperatingSystem->"os"] uses the conventions of the specified operating system. Possible choices are "Windows", "MacOSX", and "Unix".
  • FileBaseName just operates on names of files; it does not actually search for the file specified.
  • FileBaseName [File ["file"]] is also supported.

Examples

open all close all

Basic Examples  (2)

Find base name of the file:

Split off the last extension:

Scope  (3)

Leading directory names are dropped:

Force interpretation of a file name as a Windows path:

Get the base name of the file specified by the File object:

Possible Issues  (1)

The period is not considered part of the name, even if there is no extension:

Related Workflows

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

Text

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

CMS

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

APA

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

BibTeX

@misc{reference.wolfram_2025_filebasename, author="Wolfram Research", title="{FileBaseName}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/FileBaseName.html}", note=[Accessed: 17-November-2025]}

BibLaTeX

@online{reference.wolfram_2025_filebasename, organization={Wolfram Research}, title={FileBaseName}, year={2016}, url={https://reference.wolfram.com/language/ref/FileBaseName.html}, note=[Accessed: 17-November-2025]}

Top [フレーム]

AltStyle によって変換されたページ (->オリジナル) /