On Sat, Apr 17, 2010 at 8:20 PM, Sprague, Webb (OFM)
<[email protected]> wrote:
> Thanks for the answer, but it isn't quite what I am after -- I am hoping to
> set the *search path* for files which are loaded or required by a script.
>
> In a shell script, I would do this:
>
> PATH="/my/special/path:$PATH"
I am pretty sure that J does not have a PATH in the
sense you are asking for.
If you look at the source code for open:
open
open_j_
open_j_
3 :0
f=. ,getscripts y
...
And if you start walking through what happens at each step
getscripts_j_ 'strings'
...
getscripts_j_
...
jpath each <'strings'
fullname_j_ jpath 'strings'
...
jcwdpath 'strings'
jcwdpath looks like the workhorse function here, and it's
concept of a "path" looks like a "pathname" which is to
say the path followed through the file system to find
the file. But it's just one location (and 1!:43 gives the
current working directory, and jhostpath looks like it
might have a system specific definition to deal with
ambiguities in the characters used to separate directories
-- but I think this is not needed in windows, since windows
is supposed to treat '/' and '\' the same way at the file
system interface level -- its only the command line level
that distinguishes between them).
Anyways... perhaps it is time to take a step back and ask:
why do you need this?
If we focus on the problem you are trying to solve, perhaps
some better alternatives will suggest themselves.
Thanks,
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm