All Manuals > LispWorks User Guide and Reference Manual > 23 LispWorks' Operating Environment > 23.14 Special locations in the file system

NextPrevUpTopContentsIndex

23.14.2 Special Folders

On Microsoft Windows and Mac OS X there are various special folders used for application data and user data. Here are some examples of the folder for application data which is shared between all users.

Windows 7 and Windows Vista:

C:\ProgramData

Windows XP:

C:\Documents and Settings\All Users.WINDOWS\Application Data

Mac OS X:

/Library/Application Support

The locations and folder names can differ between versions of the operating system, therefore it is useful to have a system-independent way to get the path at runtime. The function get-folder-path can be used to retrieve the path to special folders. Directory pathnames corresponding to each of the examples above can be obtained by calling:

(sys:get-folder-path :common-appdata)

Here is another example of differences between operating systems. On Windows 7 and Windows Vista:

(sys:get-folder-path :my-documents)
=>
#P"C:/Users/dubya/Documents/"

On Windows 98 SE:

(sys:get-folder-path :my-documents)
=>
#P"C:/My Documents/"

On Mac OS X:

(sys:get-folder-path :my-documents)
=>
#P"/u/ldisk/dubya/Documents/"

See get-folder-path for more details.

On Windows NT-based systems there is a profile folder for each user. You can find the profile path for the current user with the function get-user-profile-directory .


LispWorks User Guide and Reference Manual - 21 Dec 2011

NextPrevUpTopContentsIndex