version 2004 (Modified)
System folder {(type)} String
Parameter | Type | Description | |
type | Longint | Type of system folder | |
Function result | String | Pathname to a system folder |
Description
The System folder command returns the pathname to a particular folder of the operating system or to the active Windows or Mac OS System folder itself.
You pass in the optional type parameter a value indicating the type of system folder. 4D provides you with the following predefined constants, placed in the "System Folder" theme:
Constant | Type | Value |
System | Long Integer | 0 |
Fonts | Long Integer | 1 |
Preferences or Profiles_All | Long Integer | 2 |
Preferences or Profiles_User | Long Integer | 3 |
Startup Items_All | Long Integer | 4 (obsolete under Mac OS, see note 1) |
Startup Items_User | Long Integer | 5 (obsolete under Mac OS, see note 1) |
Mac Shutdown Items_All | Long Integer | 6 (obsolete, see note 1) |
Mac Shutdown Items_User | Long Integer | 7 (obsolete, see note 1) |
Apple or Start Menu_All | Long Integer | 8 (obsolete under Mac OS, see note 1) |
Apple or Start Menu_User | Long Integer | 9 (obsolete under Mac OS, see note 1) |
Mac Extensions | Long Integer | 10 (obsolete, see note 1) |
Mac Control Panels | Long Integer | 11 (obsolete, see note 1) |
System Win | Long Integer | 12 |
System32 Win | Long Integer | 13 |
Favorites Win | Long Integer | 14 |
Desktop Win | Long Integer | 15 |
Program Files Win | Long Integer | 16 |
Notes:
The folders corresponding to constants 4 to 11 no longer exist under Mac OS X (they were used under Mac OS 9 only). When these constants are used under Mac OS, System folder returns an empty string.
Constants 6, 7, 10 and 11 (Mac OS only) are thus totally obsolete starting with version 2004 of 4D. Constants 4, 5, 8 and 9 however can still be used under Windows.
The constants System Win, System32 Win, Favorites Win, Desktop Win and Program Files Win can be used on Windows only. When they are used on Mac OS, System folder will return an empty string.
The pathnames to some system folders can specific to the current user. Constants 2 to 9 allow you to choose whether you want to obtain the pathname to a folder which is shared by all users, or customized for the current user.
If you omit the type parameter, the function will return the pathname to active System folder (= constant System).
See Also
Get 4D folder, Temporary folder.