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

MathGroup Archive 2002

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

Search the Archive

RE: Getting File Directory Using Any Platform

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34039] RE: [mg34013] Getting File Directory Using Any Platform
  • From: "DrBob" <majort at cox-internet.com>
  • Date: Sat, 27 Apr 2002 00:57:09 -0400 (EDT)
  • Reply-to: <drbob at bigfoot.com>
  • Sender: owner-wri-mathgroup at wolfram.com

I don't have multiple platforms to test it on, but I think this will do
it for you:

ToFileName[{$TopDirectory,"Addons","ExtraPackages","Utilities"},
    "Notation.m"]

Bobby Treat

-----Original Message-----
From: Ersek, Ted R [mailto:ErsekTR at navair.navy.mil] 
To: mathgroup at smc.vnet.net
Subject: [mg34039] [mg34013] Getting File Directory Using Any Platform

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: Memory overflow
  • Next by Date: Re: passing functions as parameters
  • Previous by thread: Getting File Directory Using Any Platform
  • Next by thread: Re: Getting File Directory Using Any Platform