Skip to content

Create Directory

Type: create-directory  ·  Package: Filesystem Activities v1.0.6  ·  Output: string

Creates a folder, automatically including every parent folder missing from the path. If the folder already exists, it does nothing (it does not fail). Use it to prepare the output structure before writing or moving files.

Creates the folder at path. If the path includes intermediate folders that do not exist (C:/output/2026/june), it creates all of them. If it already existed, it carries on without error and without touching its content: it is idempotent and safe to repeat.

The file-writing activities of this package (Write File, Append to File, Copy File, Move File) already create their destination folder; Create Directory is useful for folders other activities need to exist, or to set up an empty structure.

ParameterTypeDefaultDescription
pathstring—Path of the folder to create.

None.

Returns a string with the folder path (as you gave it in path), whether it existed before or not.

MessageCause and fix
Access to the path '…' is denied.No permission to create the folder there.
The file '…' already exists. (or another I/O error)A file with the same name as the folder already exists. Use another name.
Could not find a part of the path '…'.The drive or network share does not exist or is not connected.
'path' is required.The path expression evaluated to null.

Make sure the month’s folder exists before saving a report:

Create Directory path = pathJoin("C:/reports", today().ToString("yyyy-MM")) → output: folder
Write Excel Sheet path = pathJoin(folder, "sales.xlsx") data = sales