MathGroup Archive 2002

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

Search the Archive

Re: Re: Getting File Directory Using Any Platform

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34937] Re: [mg34023] Re: [mg34013] Getting File Directory Using Any Platform
  • From: jmt <jmt at agat.net>
  • Date: Thu, 13 Jun 2002 02:38:32 -0400 (EDT)
  • References: <200204270456.AAA27350@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

What about OSes (Unix & Linux, NT , etc.) that keep user preferences ?
Is there a reliable $UserAddOnsDirectory ? (I remember I saw something like 
that in 4.2 beta).
Can I use ToFileName[{$HomeDirectory,"Mathematica", etc}] as a probable 
location ?

jmt

On Saturday 27 April 2002 06:56, John Fultz wrote:
> A *much* easier (not to mention highly reliable) way to do this is...
>
> ToFileName[{$TopDirectory, "AddOns", "ExtraPackages", "Utilities"},
> 	"Notation.m"]
>
> And with this method, you don't have to worry about silly typos
> like the one in your Macintosh case.
>
> Sincerely,
>
> John Fultz
> jfultz at wolfram.com
> User Interface Group
> Wolfram Research, Inc.
>
> > I want a line of code that will return the directory where the Notation
> > package is located and it should return a result consistent with the
> > operating system used.  If the following doesn't work on your platform
> > please let me know. I am also interested in any improvements to this
> > code.
> >
> >
> > In[1]:=
> >   dirs=Which[
> >     $System==="Microsoft Windows","\\AddOns\\ExtraPackages\\Utilities",
> >     $System==="Machintosh",":AddOns:ExtraPackages:Utilities",
> >     True (* Unix *), "/AddOns/ExtraPackages/Utilities"
> >   ];
> >   DirectoryName[$TopDirectory<>dirs<>"Notation.m"]
> >
> >
> > Out[1]=
> >    C:\Program Files\Wolfram
> > Research\Mathematica\4.1\AddOns\ExtraPackages\
> >
> > ------------
> > Thanks,
> >   Ted Ersek
> >   Get Mathematica tips, tricks from
> >  http://www.verbeia.com/mathematica/tips/Tricks.html


  • Prev by Date: RE: Re: "TableLabel"?
  • Next by Date: Re: Re: A friendly challenge: Generalized Partition
  • Previous by thread: NDSolve and parameters
  • Next by thread: Export color bug in Mac OS X?