Look in the Vocabulary under Foreigns then Files (1!:n)
1!:43 '' is like getcwd
1!:44 stringval is like chdir
So what you described is
1!:44 '/home/fork/example'
data =. 1!:1 <((1!:43 '') , '/stuff.csv')
or you could write
data =. 1!:1 <'/home/fork/example/stuff.csv'
Henry Rich
Sprague, Webb (OFM) wrote:
> Hi all,
>
> Does J have the notion of a current working directory, such that if one
> reads in data from a file that is specified with a relative path, J gets
> the working dir and finds the specified file relative to it.
>
> Along with this general knowledge, please tell me if there are functions
> to (1) return the string of the working directory, and (2) change to a
> working directory based on a string input.
>
> Forgive me, but I will have to give an example in very non-APL ish
> pseudo code:
>
> changdir ("/home/fork/example")
> data = readata(getcwd() + "/stuff.csv")
>
> data will then have the contents of file "/home/fork/example/stuff.csv".
>
> If there is a page that documents this, a link would be much
> appreciated. Thanks again for everyone's help and patience.
>
> W
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm