$InputFileName

$InputFileName

is a global variable whose value is the absolute file name of the input file from which input to the Wolfram Language is currently being sought.

Details

  • During the execution of <<file, $InputFileName is set to the absolute file name of file.
  • During the execution of a script file through wolframscript, $InputFileName is set to the absolute file name of the script file.
  • When input does not come from a file, or comes from an interactive session, $InputFileName is "".

Examples

Basic Examples  (2)

Loading a file:

During interactive input, $InputFileName is "":

Wolfram Research (2010), $InputFileName, Wolfram Language function, https://reference.wolfram.com/language/ref/$InputFileName.html (updated 2019).

Text

Wolfram Research (2010), $InputFileName, Wolfram Language function, https://reference.wolfram.com/language/ref/$InputFileName.html (updated 2019).

CMS

Wolfram Language. 2010. "$InputFileName." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/$InputFileName.html.

APA

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

BibTeX

@misc{reference.wolfram_2024_$inputfilename, author="Wolfram Research", title="{$InputFileName}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/$InputFileName.html}", note=[Accessed: 03-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_$inputfilename, organization={Wolfram Research}, title={$InputFileName}, year={2019}, url={https://reference.wolfram.com/language/ref/$InputFileName.html}, note=[Accessed: 03-December-2024 ]}