Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Directory[]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96169] Re: Directory[]
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Sat, 7 Feb 2009 03:54:02 -0500 (EST)

On 2/6/09 at 4:14 AM, hans.malissa at gmx.net (hmalissa) wrote:

>Directory[] gives the name of the Mathematica working directory. Is
>there a possibility to get the name of the directory in which the
>notebook file is located?

With version 6 and later, if the notebook has been saved,
NotebookDirector[] will return the directory for the notebook file.

For version 5.x the following function will do what you want
again assuming the notebook has been saved.

NotebookDirectory[]:=
     DirectoryName@ToFileName["FileName"/.NotebookInformation@EvaluationNot=
ebook[]]];



  • Prev by Date: Re: Directory[]
  • Next by Date: Re: Directory[]
  • Previous by thread: Re: Directory[]
  • Next by thread: Re: Directory[]