On this page:
find-collects-dir
find-user-collects-dir
get-collects-search-dirs
get-main-collects-search-dirs
find-config-dir
find-links-file
find-user-links-file
get-links-search-files
find-pkgs-dir
find-user-pkgs-dir
get-pkgs-search-dirs
find-doc-dir
find-user-doc-dir
get-doc-search-dirs
find-lib-dir
find-user-lib-dir
find-share-dir
find-user-share-dir
find-dll-dir
get-lib-search-dirs
find-include-dir
find-user-include-dir
get-include-search-dirs
find-console-bin-dir
find-gui-bin-dir
find-user-console-bin-dir
find-user-gui-bin-dir
find-apps-dir
find-user-apps-dir
find-man-dir
find-user-man-dir
get-doc-search-url
get-installation-name
get-build-stamp
get-absolute-installation?

6.7 API for Finding Installation Directories

 (require setup/dirs) package: base
The setup/dirs library provides several procedures for locating installation directories:

procedure

(find-collects-dir)  (or/c path? #f)

Returns a path to the installation’s main "collects" directory, or #f if none can be found. A #f result is likely only in a stand-alone executable that is distributed without libraries.

procedure

(find-user-collects-dir)  path?

Returns a path to the user-specific "collects" directory; the directory indicated by the returned path may or may not exist.

Returns the same result as (current-library-collection-paths), which means that this result is not sensitive to the value of the use-user-specific-search-paths parameter.

Returns a list of paths to installation "collects" directories, including the result of find-collects-dir. These directories are normally included in the result of (current-library-collection-paths), but a PLTCOLLECTS setting or change to the parameter may cause them to be omitted. Any other path in (current-library-collection-paths) is treated as user-specific. The dierctories indicated by the returned paths may or may not exist.

procedure

(find-config-dir)  (or/c path? #f)

Returns a path to the installation’s "etc" directory, which contains configuration and package information—including configuration of some of the other directories (see Installation Configuration and Search Paths). A #f result indicates that no configuration directory is available.

procedure

(find-links-file)  path?

Returns a path to the installation’s collection links file. The file indicated by the returned path may or may not exist.

procedure

(find-user-links-file [vers])  path?

  vers : string? = (get-installation-name)
Returns a path to the user’s collection links file. The file indicated by the returned path may or may not exist.

procedure

(get-links-search-files)  path?

Returns a list of paths to installation collection links files that are search in order. (Normally, the result includes the result of (find-links-file), which is where new installation-wide links are installed by raco link or links.) The files indicated by the returned paths may or may not exist.

procedure

(find-pkgs-dir)  path?

Returns a path to the directory containing packages with installation scope; the directory indicated by the returned path may or may not exist.

procedure

(find-user-pkgs-dir [vers])  path?

  vers : string? = (get-installation-name)
Returns a path to the directory containing packages with user-specific scope for installation name vers; the directory indicated by the returned path may or may not exist.

procedure

(get-pkgs-search-dirs)  (listof path?)

Returns a list of paths to the directories containing packages in installation scope. (Normally, the result includes the result of (find-pkgs-dir), which is where new packages are installed by raco pkg install.) The directories indicated by the returned paths may or may not exist.

procedure

(find-doc-dir)  (or/c path? #f)

Returns a path to the installation’s "doc" directory. The result is #f if no such directory is available.

procedure

(find-user-doc-dir)  path?

Returns a path to a user-specific "doc" directory. The directory indicated by the returned path may or may not exist.

procedure

(get-doc-search-dirs)  (listof path?)

Returns a list of paths to search for documentation, not including documentation stored in individual collections. Unless it is configured otherwise, the result includes any non-#f result of (find-doc-dir) and (find-user-doc-dir)but the latter is included only if the value of the use-user-specific-search-paths parameter is #t.

procedure

(find-lib-dir)  (or/c path? #f)

Returns a path to the installation’s "lib" directory, which contains libraries and other build information. The result is #f if no such directory is available.

procedure

(find-user-lib-dir)  path?

Returns a path to a user-specific "lib" directory; the directory indicated by the returned path may or may not exist.

procedure

(find-share-dir)  (or/c path? #f)

Returns a path to the installation’s "share" directory, which contains installed packages and other platform-independent files. The result is #f if no such directory is available.

procedure

(find-user-share-dir)  path?

Returns a path to a user-specific "share" directory; the directory indicated by the returned path may or may not exist.

procedure

(find-dll-dir)  (or/c path? #f)

Returns a path to the directory that contains DLLs for use with the current executable (e.g., "libmzsch.dll" on Windows). The result is #f if no such directory is available, or if no specific directory is available (i.e., other than the platform’s normal search path).

procedure

(get-lib-search-dirs)  (listof path?)

Returns a list of paths to search for foreign libraries. Unless it is configured otherwise, the result includes any non-#f result of (find-lib-dir), (find-dll-dir), and (find-user-lib-dir)but the last is included only if the value of the use-user-specific-search-paths parameter is #t.

procedure

(find-include-dir)  (or/c path? #f)

Returns a path to the installation’s "include" directory, which contains ".h" files for building Racket extensions and embedding programs. The result is #f if no such directory is available.

procedure

(find-user-include-dir)  path?

Returns a path to a user-specific "include" directory; the directory indicated by the returned path may or may not exist.

Returns a list of paths to search for ".h" files. Unless it is configured otherwise, the result includes any non-#f result of (find-include-dir) and (find-user-include-dir)but the latter is included only if the value of the use-user-specific-search-paths parameter is #t.

procedure

(find-console-bin-dir)  (or/c path? #f)

Returns a path to the installation’s executable directory, where the stand-alone Racket executable resides. The result is #f if no such directory is available.

procedure

(find-gui-bin-dir)  (or/c path? #f)

Returns a path to the installation’s executable directory, where the stand-alone GRacket executable resides. The result is #f if no such directory is available.

Returns a path to the user’s executable directory; the directory indicated by the returned path may or may not exist.

procedure

(find-user-gui-bin-dir)  path?

Returns a path to the user’s executable directory for graphical programs; the directory indicated by the returned path may or may not exist.

procedure

(find-apps-dir)  (or/c path? #f)

Returns a path to the installation’s directory ".desktop" files (for Unix). The result is #f if no such directory exists.

procedure

(find-user-apps-dir)  path?

Returns a path to the user’s directory for ".desktop" files (for Unix); the directory indicated by the returned path may or may not exist.

procedure

(find-man-dir)  (or/c path? #f)

Returns a path to the installation’s man-page directory. The result is #f if no such directory exists.

procedure

(find-user-man-dir)  path?

Returns a path to the user’s man-page directory; the directory indicated by the returned path may or may not exist.

procedure

(get-doc-search-url)  string?

Returns a string that is used by the documentation system, augmented with a version and search-key query, for remote documentation links.

Returns the current installation’s name, which is often (version) but can be configured via 'installation-name in "config.rktd" (see Installation Configuration and Search Paths).

procedure

(get-build-stamp)  (or/c #f string?)

Returns a string that identifies an installation build, which can be used to augment the Racket version number to more specifically identify the build. An empty string is normally produced for a release build. The result is #f if no build stamp is available.

Returns #t if this installation uses absolute path names for executable and library references, #f otherwise.