A vicinity is a descriptor for a place in the file system. Vicinities hide from the programmer the concepts of host, volume, directory, and version. Vicinities express only the concept of a file environment where a file name can be resolved to a file in a system independent manner. Vicinities can even be used on flat file systems (which have no directory structure) by having the vicinity express constraints on the file name.
All of these procedures are file-system dependent. Use of these vicinity procedures can make programs file-system independent.
These procedures are provided by all implementations. On most systems a vicinity is a string.
Returns dirpath as a vicinity for use as first argument to
Returns the vicinity containing path.(pathname->vicinity "/usr/local/lib/scm/Link.scm") ⇒ "/usr/local/lib/scm/"
Returns the vicinity of the currently loading Scheme code. For an interpreter this would be the directory containing source code. For a compiled system (with multiple files) this would be the directory where the object or executable files are. If no file is currently loading, then the result is undefined. Warning:
program-vicinitycan return incorrect values if your program escapes back into a
Returns the vicinity of the underlying Scheme implementation. This vicinity will likely contain startup code and messages and a compiler.
Returns the vicinity of the current directory of the user. On most systems this is "" (the empty string).
Returns the ‘#t’ if chr is a vicinity suffix character; and
#fotherwise. Typical vicinity suffixes are ‘/’, ‘:’, and ‘\’,
Returns a filename suitable for use by
open-output-file, etc. The returned filename is filename in vicinity.
in-vicinityshould allow filename to override vicinity when filename is an absolute pathname and vicinity is equal to the value of
(user-vicinity). The behavior of
in-vicinitywhen filename is absolute and vicinity is not equal to the value of
(user-vicinity)is unspecified. For most systems
Returns the vicinity of vicinity restricted to name. This is used for large systems where names of files in subsystems could conflict. On systems with directory structure
sub-vicinitywill return a pathname of the subdirectory name of vicinity.
path should be a string naming a file being read or loaded.
with-load-pathnameevaluates thunk in a dynamic scope where an internal variable is bound to path; the internal variable is used for messages and
with-load-pathnamereturns the value returned by thunk.