System folder
System folder {( type )} : Text
| Parameter | Type | Description | |
|---|---|---|---|
| type | Integer | → | Type of system folder |
| Function result | Text | ← | 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 macOS 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 | Comment |
|---|---|---|---|
| Applications or program files | Integer | 16 | |
| Desktop | Integer | 15 | |
| Documents folder | Integer | 17 | "Documents" folder of user |
| Favorites Win | Integer | 14 | |
| Fonts | Integer | 1 | |
| Home folder | Integer | 18 | Current home folder of the user (usually "/Users/ |
| Start menu Win_all | Integer | 8 | |
| Start menu Win_user | Integer | 9 | |
| Startup Win_all | Integer | 4 | |
| Startup Win_user | Integer | 5 | |
| System | Integer | 0 | |
| System Win | Integer | 12 | |
| System32 Win | Integer | 13 | |
| User preferences_all | Integer | 2 | |
| User preferences_user | Integer | 3 |
Notes:
- The constants suffixed Win can be used on Windows only. When they are used on macOS, 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
Properties
| Command number | 487 |
| Thread safe | ✓ |