Re: Strange use of FrontEnd`FileName
- To: mathgroup at smc.vnet.net
- Subject: [mg71715] Re: [mg71664] Strange use of FrontEnd`FileName
- From: "厉正吉" <zhengji.li at gmail.com>
- Date: Mon, 27 Nov 2006 04:04:38 -0500 (EST)
- References: <200611260848.DAA14498@smc.vnet.net>
Philipp,
Firstly, see what's happened with the use of extract.
In[8]:=
"FileName" /. NotebookInformation[EvaluationNotebook[]]
Out[8]=
FrontEnd`FileName[{$RootDirectory, "C:", Documents and Settings", ...,
"Desktop"}, Untitled-2.nb, CharacterEncoding -> WindowsANSI]
In[9]:=
Extract["FileName" /. NotebookInformation[
EvaluationNotebook[]], {1}, FrontEnd`FileName]
Out[9]=
FrontEnd`FileName[{$RootDirectory, "C:", Documents and Settings", ...,
"Desktop"}]
Secondly, ToFileName really works with
FrontEnd`FileName[{$RootDirectory, "C:", Documents and Settings", ...,
"Desktop"}]. Let's check it out:
In[16]:=
FrontEnd`FileName[{$RootDirectory, "C:", "Desktop"}] // ToFileName (*
This is OK*)
Remove[test];
test[{$RootDirectory, "C:", "Desktop"}] // ToFileName (* This is bad *)
{$RootDirectory, "C:", "Desktop"} // ToFileName (* OK, too *)
Out[16]=
C:\Desktop\
- References:
- Strange use of FrontEnd`FileName
- From: "Philipp" <Philipp.M.O@gmail.com>
- Strange use of FrontEnd`FileName