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
in-vicinity.
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 aloadcontinuation.
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 vicinity of the user's HOME directory, the directory which typically contains files which customize a computer environment for a user. If scheme is running without a user (eg. a daemon) or if this concept is meaningless for the platform, then
home-vicinityreturns#f.
Returns the ‘#t’ if chr is a vicinity suffix character; and
#fotherwise. Typical vicinity suffixes are ‘/’, ‘:’, and ‘\’,
Returns a filename suitable for use by
slib:load,slib:load-source,slib:load-compiled,open-input-file,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 ofin-vicinitywhen filename is absolute and vicinity is not equal to the value of(user-vicinity)is unspecified. For most systemsin-vicinitycan bestring-append.
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 andprogram-vicinity.with-load-pathnamereturns the value returned by thunk.