Next: delete() Up: MacAnova Help File Previous: data_files   Contents

DATAPATHS

Keywords: files, input, output
                               Description
This topic describes how variable DATAPATHS determines where MacAnova
searches for files when you use a command such as read(), matread(),
vecread() or macroread() to read a file.  For all such commands, the
first argument is a CHARACTER scalar or quoted string specifying a file
name.  See topic 'file_names'.

DATAPATHS must be a CHARACTER scalar or vector.  Each element must be
the name (path) of a directory, ending with a separator character 
(you may use '/' on all platforms, '\' in Windows or MSDOS, and ':' on
Mac OS 9).  See topic 'file_names' for information on path names.

                             Search behavior
MacAnova first looks for the file in the default directory or folder
(see topic 'files').

If the file is not found in the default directory, MacAnova searches
for it in the directory or folder whose name is in DATAPATHS[1], then in
DATAPATHS[2] and so on.  If the file is not found in any of these, you
are informed that the file could not be opened.

                           Macro adddatapath()
You can use macro adddatapath() to add directories or folders to the
start or end of DATAPATHS.  See adddatapath().

                            Pre defined value
On windowed versions of MacAnova, DATAPATHS is initialized to have two
elements.  The first element is a standard place for MacAnova files in
the user's directory.  This is the MyMacAnovaFiles directory in the
user's home directory.  (The home directory is well defined on Mac OS X
and Unix/Linux systems; various versions of Windows have home
directories for users, often in the Documents and Settings directory.)
The second element is a standard directory in the MacAnova installation.
(See the option -appdir under topic 'launching'.)

                           Changing the value
You can change the defaults by setting DATAPATHS in a start up file, or
by setting environmental variable MACANOVA, or by command line options.
See topics 'customize' and 'launching'.  

For compatibility with earlier versions of MacAnova, if variable
DATAPATHS does not exist, variable DATAPATH is substituted, if it
exists.

                                Examples
                           Windows/DOS example
Windows and DOS:
  When DATAPATHS is vector("A:/SURVEY/", "C:/MACANOVA/"),
  read("mydata.dat") first tries to read MYDATA.DAT in the default
  directory or folder and then, if not successful, tries to read
  A:\SURVEY\MYDATA.DAT and C:\MACANOVA\MYDATA.DAT.

                     Unix/Linux and Mac OS X example
Unix/Linux:
  When DATAPATHS is vector("/users/joe/survey/", "/usr/lib/macanova/"),
  read("mydata.dat") first tries to read mydata.dat in the current
  default directory, and then, if not successful, it tries to read file
  /users/joe/survey/mydata.dat and /usr/lib/macanova/mydata.dat.


Gary Oehlert 2005-08-12