Skip to main content
Version: Next

Folder

History
ReleaseChanges
19 R8Support of fk home folder
17 R5Added

Folder ( path : Text { ; pathType : Integer }{ ; * } ) : 4D.Folder
Folder ( folderConstant : Integer { ; * } ) : 4D.Folder

ParameterTypeDescription
pathTextFolder path
folderConstantInteger4D folder constant
pathTypeIntegerfk posix path (default) or fk platform path
*operator* to return folder of host database
Result4D.FolderNew folder object

Description

The Folder command creates and returns a new object of the 4D.Folder type. The command accepts two syntaxes:

Folder ( path { ; pathType } { ; * } )

In the path parameter, pass a folder path string. You can use a custom string or a filesystem (e.g., "/DATA").

Only absolute pathnames are supported with the Folder command.

By default, 4D expects a path expressed with the POSIX syntax. If you work with platform pathnames (Windows or macOS), you must declare it using the pathType parameter. The following constants are available:

ConstantValueComment
fk platform path1Path expressed with a platform-specific syntax (mandatory in case of platform pathname)
fk posix path0Path expressed with POSIX syntax (default)

Folder ( folderConstant { ; * } )

In the folderConstant parameter, pass a 4D built-in or system folder, using one of the following constants:

ConstantValueComment
fk applications folder116
fk data folder9Associated filesystem: "/DATA"
fk database folder4Associated filesystem: "/PACKAGE"
fk desktop folder115
fk documents folder117Document folder of the user
fk home folder118Current home folder of the user (usually /Users/<username>/)
fk licenses folder1Folder containing the machine's 4D license files
fk logs folder7Associated filesystem: "/LOGS"
fk mobileApps folder10
fk remote database folder34D database folder created on each 4D remote machine
fk resources folder6Associated filesystem: "/RESOURCES"
fk system folder100
fk user preferences folder04D folder that stores user preference files within the user home folder
fk web root folder8Current Web root folder of the database: if within the package "/PACKAGE/path", otherwise full path

If the command is called from a component, pass the optional * parameter to get the path of the host database. Otherwise, if you omit the * parameter, a null object is always returned.

On Windows, in merged clients, the location of built-in folders is modified if the ShareLocalResourcesOnWindowsClient BuildApp key is used.

See also

File
Object to path
Path to object