MathGroup Archive 2010

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

Search the Archive

Re: Automatically identifying a directory

  • To: mathgroup at smc.vnet.net
  • Subject: [mg108403] Re: Automatically identifying a directory
  • From: Albert Retey <awnl at gmx-topmail.de>
  • Date: Tue, 16 Mar 2010 05:58:17 -0500 (EST)
  • References: <hnnk1r$cfn$1@smc.vnet.net>

Am 16.03.2010 10:46, schrieb Will DeBeest:
> When using notebooks I can use NotebookDirectory[] to return a string
> for the notebook path. Unless I've missed something obvious there
> doesn't appear to be a way of automatically finding directories if you
> are running *.m files remotely from a terminal. Basically I have an
> *.m file and I'd like to have something like MFileDirectory[] so that
> the path is identified when the file is run remotely. It seems simple/
> obvious. Any ideas?

AFAIK there is nothing likte NotebookDirectory for package files. But
you can create something with $Input, FindFile and FileNames. E.g. I
think this should work in many cases:

FindFile[$Input]

but it might depend on how you start the .m file so you might need to
experiment to get the desired result. You might also want to look at the
tutorial tutorial/NamingAndFindingFiles for more functions related to
the topic.

hth,

albert



  • Prev by Date: Styling print output
  • Next by Date: Re: Findroot
  • Previous by thread: Automatically identifying a directory
  • Next by thread: Re: Automatically identifying a directory