Re: Re: file functions & FrontEnd`FileName
- To: mathgroup at smc.vnet.net
- Subject: [mg73141] Re: [mg73098] Re: file functions & FrontEnd`FileName
- From: "Chris Chiasson" <chris at chiasson.name>
- Date: Sun, 4 Feb 2007 07:49:26 -0500 (EST)
- References: <eps7gh$9c1$1@smc.vnet.net> <200702030900.EAA03139@smc.vnet.net>
The only thing I might add to this is a wrapper on the output to indicate that the path is for the front end's associated file system, which may or may not be on the same file system as the kernel. On 2/3/07, David Reiss <dbreiss at gmail.com> wrote: > In[1]:= > file=FrontEnd`FileName[{$RootDirectory,"Users","dreiss","Desktop"}, > "DirectoryExtension.nb"] > > Out[1]= > FrontEnd`FileName[{$RootDirectory,Users,dreiss,Desktop},DirectoryExtension.nb] > > In[2]:= > DirectoryName[file] > > Out[2]= > DirectoryName[ > FrontEnd`FileName[{$RootDirectory,Users,dreiss,Desktop}, > DirectoryExtension.nb]] > > In[3]:= > Unprotect[DirectoryName] > > Out[3]= > {} > > In[4]:= > DirectoryName[z_? > (Head[#]===FrontEnd`FileName&)]:=DirectoryName[ToFileName[z]] > > In[5]:= > Protect[DirectoryName] > > Out[5]= > {DirectoryName} > > In[6]:= > DirectoryName[file] > > Out[6]= > /Users/dreiss/Desktop/ > > > > --David > A WorkLife FrameWork version 1.1 is now available at > > http://www.scientificarts.com/worklife > > > On Feb 1, 3:14 am, "Chris Chiasson" <c... at chiasson.name> wrote: > > It would be nice (heh) if DirectoryName and FileType could work > > directly on FrontEnd`FileName objects. In the case of DirectoryName, > > it might be wise to generate a new type of FrontEnd` symbol to hold > > the result string. I don't know if there are other functions that > > could benefit from this treatment. > > > > Thanks for listening, > > > > --http://chris.chiasson.name/ > > > -- http://chris.chiasson.name/
- References:
- Re: file functions & FrontEnd`FileName
- From: "David Reiss" <dbreiss@gmail.com>
- Re: file functions & FrontEnd`FileName