Re: Strange use of FrontEnd`FileName
- To: mathgroup at smc.vnet.net
- Subject: [mg71718] Re: [mg71664] Strange use of FrontEnd`FileName
- From: "Chris Chiasson" <chris at chiasson.name>
- Date: Mon, 27 Nov 2006 04:04:46 -0500 (EST)
- References: <200611260848.DAA14498@smc.vnet.net>
If the user works on a system where the kernel is run on a computer with a different file system than that of the computer running the front end, there needs to be a way to distinguish between the different file systems. I wonder what else ToFileName can do. I had to write an entire set of functions to handle the output of $Input because it gives a relative path when executed inside a package. I bet there is already a nice set of internal functions that handles these situations. It would be great to see them exposed/published for the users. On 11/26/06, Philipp <Philipp.M.O at gmail.com> wrote: > 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. > > -- http://chris.chiasson.name/
- References:
- Strange use of FrontEnd`FileName
- From: "Philipp" <Philipp.M.O@gmail.com>
- Strange use of FrontEnd`FileName