Re: How to find out which directory a .m file is loaded from?
- To: mathgroup at smc.vnet.net
- Subject: [mg38949] Re: How to find out which directory a .m file is loaded from?
- From: "John Jowett" <John.Jowett at cern.ch>
- Date: Tue, 21 Jan 2003 07:39:29 -0500 (EST)
- Organization: CERN
- References: <b0ddnb$i9e$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
John, A few years ago, I felt this need and wrote a function to fill it. Although I don't recall ever having problems with it, I am sure it not completely reliable. The usage message makes this clear: packageSourceDirectory["package"] returns the list of directories where the \ source of the first currently loaded package containing "package" in its \ context string might be located. If you are interested you can go to http://jowett.home.cern.ch/jowett/Mathematica/ and download the notebook defining the BumpEtc utility package. Perhaps someone can improve on this function ? John Jowett "John Harper" <jharper at cisco.com> wrote in message news:b0ddnb$i9e$1 at smc.vnet.net... > I'd like, in a .m file for a package, to be able to know what directory > the .m file is being loaded from, so I can search in the same place > (or subdirectories) for related files. I've looked through everything > to do with directories I can find in The Book, but I can't find anything > that looks as though it would help. > > Anyone know how to do this? Thanks in advance... > > John > > >