Previous: Operations on Pathnames, Up: Pathnames
This section gives some standard operations on host objects, and some procedures that return some useful pathnames.
This variable has as its value the host object that describes the local host's file system.
Returns
#t
if host1 and host2 denote the same pathname host; otherwise returns#f
.
Returns a pathname for the user's initialization file on host. The host argument defaults to the value of
local-host
. If the initialization file does not exist this procedure returns#f
.Under unix, the init file is called .scheme.init; under Windows and OS/2, the init file is called scheme.ini. In either case, it is located in the user's home directory, which is computed by
user-homedir-pathname
.
Returns a pathname for the user's “home directory” on host. The host argument defaults to the value of
local-host
. The concept of a “home directory” is itself somewhat implementation-dependent, but it should be the place where the user keeps personal files, such as initialization files and mail.Under unix, the user's home directory is specified by the
HOME
environment variable. If this variable is undefined, the user name is computed using thegetlogin
system call, or if that fails, thegetuid
system call. The resulting user name is passed to thegetpwnam
system call to obtain the home directory.Under OS/2, several heuristics are tried to find the user's home directory. First, if the environment variable
HOME
is defined, that is the home directory. IfHOME
is undefined, but theUSERDIR
andUSER
environment variables are defined and the directory %USERDIR%\%USER% exists, then it is used. Failing that, if the directory %USER% exists on the OS/2 system drive, then it is used. As a last resort, the OS/2 system drive is the home directory.Like OS/2, the Windows implementation uses heuristics based on environment variables. The user's home directory is computed by examining several environment variables, in the following order:
HOMEDRIVE
andHOMEPATH
are both defined and %HOMEDRIVE%%HOMEPATH% is an existing directory. (These variables are automatically defined by Windows NT.)HOME
is defined and %HOME% is an existing directory.USERDIR
andUSERNAME
are defined and %USERDIR%\%USERNAME% is an existing directory.USERDIR
andUSER
are defined and %USERDIR%\%USER% is an existing directory.USERNAME
is defined and %USERNAME% is an existing directory on the Windows system drive.USER
is defined and %USER% is an existing directory on the Windows system drive.- Finally, if all else fails, the Windows system drive is used as the home directory.
Locates pathname in MIT/GNU Scheme's system library directory. An error of type
condition-type:file-operation-error
is signalled if pathname cannot be located on the library search path.(system-library-pathname "compiler.com") => #[pathname 45 "/usr/local/lib/mit-scheme/compiler.com"]
Locates the pathname of an MIT/GNU Scheme system library directory. An error of type
condition-type:file-operation-error
is signalled if pathname cannot be located on the library search path.(system-library-directory-pathname "options") => #[pathname 44 "/usr/local/lib/mit-scheme/options/"]