Next: files Up: MacAnova Help File Previous: fastanova()   Contents

file_names

Keywords: files, input, output
This topic summarizes information about the names of files recognized by
MacAnova, absolute and relative path names, and the use of '~' and
variable HOME in abbreviating file names.

See topic 'files' for information on the default directory or folder.

See topic 'DATAPATHS' for information on CHARACTER vector DATAPATHS and
how it specifies where MacAnova searches for files.

                               File Names
You specify a file name by a quoted string or CHARACTER scalar (see
topic 'scalars') such as "macanova.dat".  It must be a legal file name
for your system.  When MacAnova decides it is not a legal name it prints
the message
   ERROR: improper file name xxxxxxx.

On some systems, the checks exclude some technically legal file names.
For example, in Unix/Linux, MacAnova objects to names starting with '-'
such as "-savefile" and on a Macintosh, it objects to file names
starting with '.' such as ".savefile", because their use often leads to
difficulties.

The Windows version understands long file names when running under
Windows 95 and Windows NT, but only classic '8+3' file names when it is
running under Windows 3.1.  The DOS versions don't recognize long file
names at all.

                        Use of "" as a file name
In versions with windows (Macintosh, Windows, Motif), you can always use
the 'empty string' "" as a file name.  This brings up a dialog box in
which you can select a folder and a file.  It also may change the
default directory or folder.  See topic 'files'.

                               Path Names
If your file name includes directory or folder information, it is a
'path name' and can be relative or absolute.  In the next paragraphs,
for a Macintosh or Windows 95/98/NT, 'directory' should be taken to mean
'folder'.  This information is fairly technical.

Relative paths
  Under DOS/Windows or Unix/Linux, a file name that specifies a relative
  path might be "../data.dir/mydata" or "tseries.dir/tseries.dat" (under
  Windows or DOS you could replace '/' by '\\').

  On a Macintosh, a relative path starts with ":".  Examples would be
  "::data.dir:mydata" and ":tseries.dir:tseries.dat".

  These examples specify a file 'mydata' in a directory 'data.dir' in
  the "parent" directory of the default directory, and a file
  'tseries.dat' in a sub-directory 'tseries.dir' in the default
  directory.

Absolute paths
  On Unix/Linux, "/usr/lib/macanova/survey.dat" is a typical absolute
  path name.  It must start with '/'.

  On Windows and DOS an absolute path name starts with '/' or 'X:/'
  where 'X' is a designator such as 'A' or 'C' of a disk drive.  For
  example, if the current DOS default drive is drive 'C', both
  "C:/data.dir/survey.dat" and "/data.dir/survey.dat" specify the same
  file.

  On a Macintosh, an absolute path name starts with a disk name and
  contains at least one ":".  Example: "MyFloppy:data.dir:survey.dat".

               Use of '~' in file names and variable HOME
You may be able to use an abbreviated file name like "~/Name" (Windows,
DOS and Unix/Linux) or "~:Name" (Macintosh), where "Name" is the name of
a file.  For this to work, a CHARACTER scalar HOME must exist and
contain the complete name (absolute path) of a directory.

In Windows and DOS, for example, if HOME is "C:/SURVEY", "~/mydata.dat"
becomes "C:/SURVEY/mydata.dat". On a Macintosh, when HOME is
"MyFloppy:Survey", "~:mydata.dat" becomes "MyFloppy:Survey:mydata.dat".

On a Macintosh or DOS/Windows computer, HOME is pre-defined to be the
full name of the folder or directory where the executable Macintosh
program is located.  On Unix/Linux, HOME is predefined to be the user's
home directory (environmental variable $HOME).  On Unix/Linux, Windows
and DOS you can override the default using command line option -home.
See topic 'launching'.  See topic 'customize' for information on
changing the default.

On Unix/Linux computers, a file name of the form ~name/filename, where
name is the log in name of another user, ~name is translated to the name
of that user's home directory, following a convention used in the csh
shell.


Gary Oehlert 2003-01-15