8
$\begingroup$

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,

$PackageDir=DirectoryName[$InputFileName];
svgParser=XML`Parser`InitializeXMLParser["svg",
     FileNameJoin[{$PackageDir,"Cache/svg10.dtd"}]]
$\endgroup$

1 Answer 1

8
$\begingroup$

You can try

System`Private`$InputFileName

Seems to work on M7, not sure about M6.

$\endgroup$
2
  • $\begingroup$ it also seems to work with version 6... $\endgroup$ Commented May 27, 2013 at 17:20
  • $\begingroup$ @AlbertRetey So more the better! Thanks for checking, I don't currently have V6 installed. $\endgroup$ Commented May 27, 2013 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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