DirCreate
- Last UpdatedOct 29, 2026
- 2 minute read
Creates the specified directory.
|
Function |
Group |
Execution |
String Exp. |
Windows |
Windows Embedded |
IoT View |
Thin Clients |
Mobile Access |
|---|---|---|---|---|---|---|---|---|
|
DirCreate |
File |
Synchronous |
No |
Supported |
Supported |
Supported |
Executed on Server (see Notes below) |
Supported |
Syntax
DirCreate( strDirectory, optBooFullPath )
strDirectory
The name and file path of the directory to create.
Note: Follow the conventions of the target platform for the file path and name, and separators. For example, a file path in Windows starts with a drive letter and uses backward slashes as separators (C:\path\to\file), while a file path in Linux starts at the root directory and uses forward slashes as separators (/path/to/file).
optBooEmptyOnly
Optional flag. If omitted or if this parameter has the value 0, the directory is created only if all previous directories exist. If this parameter has the value different from 0, the full path specified in the strDirectory parameter is created.
Returned value
|
-1 |
Invalid parameters |
|
0 |
Failed to create the directory (for example, Drive does not exist.) |
|
1 |
Directory created successfully. |
Notes
By default, this function is executed on the project runtime server even when it is called in a screen on a project thin client, which means it only affects directories and files that are located on the server and all paths must be specified in that context. You can change the default behavior to force this function to be executed on the client where it is called, but if you do so, you must keep in mind that the change will affect not just this function but also several other File functions. To change the behavior of these functions, use a text editor to open your project file (<project name>.app) and then edit the following property:
[Options]
ExecuteFileFunctionsOnClient=1
Examples
|
Tag Name |
Expression |
|---|---|
|
Tag |
DirCreate("C:\Studio\Temp") // The Temp folder is created in the C:\Studio path (only if the C:\Studio path already exists). |
|
Tag |
DirCreate("C:\Studio\Temp",1) // The C:\Studio\Temp full path is created. |