Mathematica 9 is now available
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: [mg96157] Re: [mg96143] Directory[]
  • From: "David Annetts" <davidannetts at aapt.net.au>
  • Date: Sat, 7 Feb 2009 03:51:47 -0500 (EST)
  • References: <200902060914.EAA03197@smc.vnet.net>

Hi Hans,

> 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?
> For example: I neet to import data files into Mathematica, 
> and the data files are located in the same directory as the 
> notebook file itself. If I use absolute pathnames, importing 
> will not work if the notebook and the data files are moved to 
> a different directory.

If you're using a version >= 6, you can use 

	SetDirectory@NotebookDirectory[];

to do this.

If you're not, then the answer's in this group's archives.

Regards,

Dave.




  • References:
  • Prev by Date: Re: Log[x]//TraditionalForm
  • Next by Date: Re: Default Symbol Names in Package Functions
  • Previous by thread: Re: Directory[]
  • Next by thread: Re: Directory[]