MathGroup Archive 2002

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

Search the Archive

Re: path problem

  • To: mathgroup at
  • Subject: [mg32397] Re: [mg32394] path problem
  • From: Roberto Brambilla <rlbrambilla at>
  • Date: Sat, 19 Jan 2002 01:16:30 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Hi, L.X.Li

I have put this 2 functions in the file

ThisNotebookDirectory[] :=
Block[{info = NotebookInformation[InputNotebook[]]},
	If[FreeQ[info, "FileName", {2}], Message[nbdir::nofile];
       Directory[],ToFileName[First["FileName" /. info]]]];

Hinc[] := SetDirectory[ThisNotebookDirectory[]];

Then at the beginning of a notebook I put the cell


Running it, the active directory becomes the directory where the notebook is,
independently where you start the actual Mathematica session
(hinc et nunc -> latin for 'Here&Now', also used by german phylosopher M.

Hoping this help you , bye

Roberto Brambilla
Via Rubattino 54
20134 Milano
tel +39.02.2125.5875
fax +39.02.2125.5492
rlbrambilla at

  • Prev by Date: Re: Thread? Through? Operate?
  • Next by Date: Simulating Correlated non-Normal Random Variables
  • Previous by thread: path problem
  • Next by thread: Re: path problem