The function
get-folder-path
obtains the current value for various special folders often used by applications. It is useful because these paths may differ between versions of the operating system.
get-folder-path
is implemented only on Microsoft Windows and Mac OS X.
what
indicates the purpose of the special folder. For instance,
:common-appdata
means the folder containing application data for all users.
The following values of what are recognized on Microsoft Windows and Mac OS X:
:appdata
,
:documents
,
:my-documents
,
:common-appdata
,
:common-documents
and
:local-appdata
.
:documents
is an alias for
:my-documents
.
The following values are recognized on Microsoft Windows only:
:program-files
,
:programs
and
:common-programs
.
The following values are recognized on Mac OS X only:
:my-library
,
:my-appsupport
,
:my-preferences
,
:my-caches
,
:my-logs
,
:common-library
,
:common-appsupport
,
:common-preferences
,
:common-caches
,
:common-logs
,
:system-library
.
On Mac OS X,
:appdata
is an alias for
:my-appsupport
,
:common-appdata
is an alias for
:common-appsupport
, and
:local-appdata
is an alias for
:common-appsupport
.
If the folder does not exist and
create
is true, the folder is created. The default value of
create
is
nil
.
This form constructs a pathname to a file
foo.lisp
in the user's documents directory:
(make-pathname
:name "foo"
:type "lisp"
:defaults
(sys:get-folder-path :my-documents))
LispWorks User Guide and Reference Manual - 21 Dec 2011