>>  <<  Ndx  Usr  Pri  JfC  LJ  Phr  Dic  Rel  Voc  !:  wd  Help  User

Directory Paths in J

Directory Foreigns

1!:43 y      Query Current Working Directory
1!:44 y      Set Current Working Directory

Folder Tables

JFE defines BINAPTH_z_ as the full path to the J bin folder that contains JFE, JE, and profile.ijs.

profile.ijs, before it boots up the rest of the standard library, defines SYSTEMFOLDERS_j_ as a 2-column table of folder names and paths.

USERFOLDERS_j_ is a 3-column table of folder names, paths, and subfolder indicator. It is defined from the user's configuration script config.ijs. This table is referenced by Find in Files and Project Manager. You can modify this table as you wish with Edit|Configure. As much as possible it should be defined relative to the names in SYSTEMFOLDERS_j_. For example,

|Projects|~user\projects          |0|
|User    |~user                   |0|
|System  |~system                 |0|
|Addons  |~addons                 |0|
A subfolder is a folder that is a subdirectory of another folder in USERFOLDERS_j_. It is intended for use in Project Manager, to make it easy to work with subsets of large projects. Project Manager treats subfolders like ordinary folders except that when saving the project, the project folder name used is that of the parent folder. For example, when working with the J library source, a folder name Source should be defined. Then if working only with the source for plot, you can defined a subfolder Plot to point to the plot subdirectories. For example:
|LTsrc |c:\lt\source     |0|
|LTrel |c:\lt\release    |0|
|JPB   |d:\jss\jpb\source|0|
|JST   |d:\jst\source    |0|
|JSTdev|d:\jst\dev       |0|
Note that some paths in the default USERFOLDERS table are the same as in the SYSTEMFOLDERS table. This is intentional, nevertheless you are free to remove or modify such entries in USERFOLDERS. To avoid conflicts between the folder names (first column) in the two tables, we suggest that you use an initial capital letter in the folder names of USERFOLDERS, since folder names in SYSTEMFOLDERS are all lowercase.

Directory Verbs

The profile defines the following verbs in the z locale:
jpath       converts argument to a full path name
jcwdpath    return current working directory
jhostpath   convert separators in filename to host operating system
These verbs are used to provide the full pathname for files, and to ensure that the path separator is correct for the host operating system. For example:
   jpath '~system\main\dates.ijs'

   jhostpath 'system\main/dates.ijs'    NB. in Windows

   jcwdpath ''

   jcwdpath 'system\main'


Verb jpath references the folder tables. It converts strings with folder names preceded with ~, for example ~Mywork. The folder name is read up to the first path separator or the end, for example:
  jpath '~temp'

  jpath '~temp\t2.ijs'

  jpath '~JPB\classes\board\init.ijs'
Where the folder name is preceded with ~., for example ~.Mywork, this refers to the corresponding parent directory, for example:
  jpath '~.JPB\dev\regtest.ijs'

  jpath '~..JPB\release\pbr.ijs'
Verb jpath also converts path separators to the current path separator, and so can be used instead of jhostpath (which is still supported).

Verbs load, require and script call jpath, and so recognize ~path names, e.g.
  load '~JPB\classes\board\init.ijs'
  require '~user\projects\run\run.ijs'

Project Manager

Project Manager stores names in ~path form, when files are added to the project. This means that developers working on the same project can use different directories, as long as they have made appropriate folder definitions.

The conversion process:

Existing names in a project are not converted. Therefore you can edit the project file to replace any ~path name with a full filename, and this will be preserved.

Earlier versions of Project Manager stored some names as a relative path name, starting from the J executable directory. Such names are converted to ~path form.

The Look In combobox in Project Manager displays entries in USERFOLDERS, except those pointing to the J system directory. The reason for the exclusion is that projects should not be developed in the J system directory.

>>  <<  Ndx  Usr  Pri  JfC  LJ  Phr  Dic  Rel  Voc  !:  wd  Help  User