Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What would be a good replacement for $InputFileName (which has been added recently to Mathematica 8) to achieve backwards compatibility with let's say M6 and M7?

I am using it for loading auxiliary data from a package file and found that it is a convenient way to use relative paths for this purpose. However, I am not sure how to achieve this in M6 and M7.

For example,

share|improve this question
up vote 8 down vote accepted

You can try


Seems to work on M7, not sure about M6.

share|improve this answer
it also seems to work with version 6... – Albert Retey May 27 '13 at 17:20
@AlbertRetey So more the better! Thanks for checking, I don't currently have V6 installed. – Leonid Shifrin May 27 '13 at 17:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.