MathGroup Archive 2006

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

Search the Archive

Strange use of FrontEnd`FileName


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