MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Path to *.m file

  • To: mathgroup at
  • Subject: [mg86402] Re: Path to *.m file
  • From: David Reiss <dbreiss at>
  • Date: Mon, 10 Mar 2008 02:05:52 -0500 (EST)
  • References: <fr0cr7$ekp$>

CurrentValue["NotebookFullFileName"] if you are executing the .m file
as an open file in the FrontEnd.

However, if you are using Get, for example, on the file from a
notebook, then you certainly will be using the path to the file as an
argument to Get.  Then you can first assign that path to a variable
and call it from within the .m file.  If yu are using Needs on that
file's context (or get, for that matter) you will first need to look
in the context paths given by Contexts[] to see where the file is
located (assuming that it is unique--if not then it will be the first
occurrence in the list of of contexts).  Then you can use that file
path in the previously mentioned variable....

Offhand I don't know a way using something like CurrentValue to get
the location of the file from within the file if it is not first

Hope that this helps...
A WorkLife FrameWork
E x t e n d i n g MATHEMATICA's Reach...

On Mar 9, 6:06=A0am, Frank Scherbaum <Frank.Scherb... at geo.uni-> wrote:
> Hi,
> is there a way to =A0obtain the full path to a *.m file from within that
> same file under Mathematica 6?
> Frank
> Frank Scherbaum
> Institut f=FCr Geowissenschaften
> Universit=E4t Potsdam
> Karl-Liebknecht-Str. 24
> D-14476 Potsdam-Golm
> Tel.: +49-331-977-5870/71
> Fax: +49-331-977-5700
> f... at geo.uni-potsdam.de

  • Prev by Date: Re: Evaluating notebooks from other notebooks
  • Next by Date: Re: Re: changing style of vertices for ShowGraph with Combinatorica
  • Previous by thread: Re: Path to *.m file
  • Next by thread: Re: Path to *.m file