Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

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/


  • Prev by Date: Re: How to find all folder within a specified directory?
  • Next by Date: Re: graphing with dates and values
  • Previous by thread: Re: file functions & FrontEnd`FileName
  • Next by thread: loglogplot