$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)
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