Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Directory ? Not the current working one !

  • To: mathgroup at
  • Subject: [mg72710] Re: [mg72680] Directory ? Not the current working one !
  • From: gardyloo <gardyloo at>
  • Date: Tue, 16 Jan 2007 02:55:27 -0500 (EST)

Hi, Laura,

   This is one of those useful functions that I've collected from
somewhere (probably from this list) and found so useful that it's
automatically loaded from a package I wrote.

WhereDoIDwell[] := ToFileName[Extract["FileName" /.
       NotebookInformation[EvaluationNotebook[]], {1},

(* that will return the directory of the currently open notebook, IF it
is not a new, unsaved notebook. You can probably modify it easily to
accommodate that case *)

   Hope that helps!



Laura Dabene wrote:
> Hi
> I need a way to detect the directory a notebook has been saved in,
> but none gotten by mean of ?*Directory* seems to be useful.
> As example, if MyNotebook.nb was saved in c:\MyDirectory
> I would love to get
> In  = WhereDoIDwell[]
> Out = "c:\MyDirectory"
> instead of the current working directory as given by Directory[].
> Any hints ? Thanks you a lot.
> Laura 

Curtis Osterhoudt          
gardyloo at
PGP Key ID: 0x088E6D7A
Please avoid sending me Word or PowerPoint attachments

  • Prev by Date: Difficulties with Complex-Modulus Series
  • Next by Date: Re: An Introduction to Programming with Mathematica, Third Edition
  • Previous by thread: Re: Directory ? Not the current working one !
  • Next by thread: Re: Directory ? Not the current working one !