$Input is a global variable whose value is the name of the stream from which input to Mathematica is currently being sought.
During the execution of <<file, $Input is set to "file".
During interactive input, $Input is "".
See Section 2.12.4 and Section 2.14.1.
See also: Get, Streams, DirectoryName, ToFileName, $BatchInput, $ParentLink.
New in Version 2.