MathGroup Archive 2009

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

Search the Archive

Re: Directory[]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96154] Re: [mg96143] Directory[]
  • From: Curtis Osterhoudt <cfo at lanl.gov>
  • Date: Sat, 7 Feb 2009 03:51:12 -0500 (EST)
  • Organization: LANL
  • References: <200902060914.EAA03197@smc.vnet.net>
  • Reply-to: cfo at lanl.gov

On Friday 06 February 2009 02:14:13 am 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?
> 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.
> 
> 

returnCurrent[]:=ToFileName[Extract[FileName/.NotebookInformation[EvaluationNotebook[]],{1},FrontEnd`FileName]]

        Hope that helps!
                    C.O.

-- 
==========================================================
Curtis Osterhoudt
cfo at remove_this.lanl.and_this.gov
PGP Key ID: 0x4DCA2A10
Please avoid sending me Word or PowerPoint attachments
See http://www.gnu.org/philosophy/no-word-attachments.html
==========================================================


  • References:
  • Prev by Date: Re: Directory[]
  • Next by Date: How to simplify?
  • Previous by thread: Re: Directory[]
  • Next by thread: Re: Directory[]