This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v19.8
Folder
|
Folder ( path | 4Dfolder {; pathType | *} ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
path | 4Dfolder | Text, Longint |
![]() |
Folder path or 4D folder constant | |||||
pathType | * | Longint, Operator |
![]() |
If path passed: fk posix path (default) or fk platform path If 4Dfolder passed: * to return folder of host database |
|||||
Function result | Object |
![]() |
New folder object | |||||
The Folder command creates and returns a new object of the Folder type. The command accepts two syntaxes.
In the path parameter, pass a folder path string. You can use a custom string or a "filesystem" (e.g., "/DATA").
Note: Only absolute pathnames are supported with the Folder command. For more information, please refer to the File and folder object pathnames page.
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 in the File and Folder constant theme:
Constant | Type | Value | Comment |
fk platform path | Longint | 1 | Path expressed with a platform-specific syntax (mandatory in case of platform pathname) |
fk posix path | Longint | 0 | Path expressed with POSIX syntax (default) |
In the 4Dfolder parameter, pass a 4D built-in or system folder, using one of the following constants:
Constant | Value | Comment |
fk applications folder | 116 | |
fk data folder | 9 | Associated filesystem: "/DATA" |
fk database folder | 4 | Associated filesystem: "/PACKAGE" |
fk desktop folder | 115 | |
fk documents folder | 117 | Document folder of the user |
fk licenses folder | 1 | Folder containing the machine's 4D license files |
fk logs folder | 7 | Associated filesystem: "/LOGS" |
fk mobileApps folder | 10 | Associated filesystem: "/DATA" |
fk remote database folder | 3 | 4D database folder created on each 4D remote machine |
fk resources folder | 6 | Associated filesystem: "/RESOURCES" |
fk system folder | 100 | |
fk user preferences folder | 0 | 4D folder that stores user preference files within the <userName> directory. |
fk web root folder | 8 | Current 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, an empty string is always returned.
The returned folder object contains the following properties and methods:
Properties:
Methods:
folder.copyTo( ) |
folder.create( ) |
folder.path |
folder.createAlias( ) |
folder.delete( ) |
folder.file( ) |
folder.files( ) |
folder.folder( ) |
folder.folders( ) |
folder.getIcon( ) |
folder.moveTo( ) |
folder.rename( ) |
Form.curfolder:=Folder(fk database folder)
Form.curfolder:=Folder("C:\\Users\\JohnSmith\\"; fk platform path)
Product: 4D
Theme: File and Folder
Number:
1567
Created: 4D v17 R5
4D Language Reference ( 4D v19)
4D Language Reference ( 4D v19.1)
4D Language Reference ( 4D v19.4)
4D Language Reference ( 4D v19.5)
4D Language Reference ( 4D v19.6)
4D Language Reference ( 4D v19.7)
4D Language Reference ( 4D v19.8)