Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Strange use of FrontEnd`FileName

  • To: mathgroup at smc.vnet.net
  • Subject: [mg71664] Strange use of FrontEnd`FileName
  • From: "Philipp" <Philipp.M.O at gmail.com>
  • Date: Sun, 26 Nov 2006 03:48:46 -0500 (EST)

In the Wolfram documentation (Services & Resources > Mathematica >
Kernels and Programming) there is a method "How can I automatically set
Mathematica's working directory to the same directory containing my
notebook?"
(http://support.wolfram.com/mathematica/kernel/interface/notebookdir.html)

The statement is,

SetDirectory[ToFileName[
 Extract["FileName" /. NotebookInformation[EvaluationNotebook[]], {1},
   FrontEnd`FileName]]]

Would somebody kindly explain to me as to why Extract wraps the
extracted directory list in FrontEnd`FileName before ToFileName is
applied?

Nominally, it shouldn't work. The ToFileName documentation indicates
that the directory argument can have "only" a String or List head.

Cheers,

Philipp.


P.S. I realise FrontEnd`FileName has HoldAll attribute. This only leads
to an additional question, why the directory list needs to be passed to
ToFileName unevaluated. P.


  • Prev by Date: Using subscripts in function-parameter names
  • Next by Date: Re: Plotting a function -
  • Previous by thread: Re: Using subscripts in function-parameter names
  • Next by thread: Re: Strange use of FrontEnd`FileName