impure functioncreateDirectory

Create directory (if directory already exists, ignore call)

Extends from Modelica.Icons.Function (Icon for functions).

Information

Syntax

Files.createDirectory(directoryName);

Description

Creates directory "directoryName". If this directory already exists, the function call is ignored. If several directories in "directoryName" do not exist, all of them are created. For example, assume that directory "E:/test1" exists and that directory "E:/test1/test2/test3" shall be created. In this case the directories "test2" in "test1" and "test3" in "test2" are created.

This function is silent, i.e., it does not print a message. In case of error (e.g., "directoryName" is an existing regular file), an assert is triggered.

Inputs

TypeNameDefaultDescription
StringdirectoryNameName of directory to be created (if present, ignore call)

Contents

NameDescription
existDirectoryprotectedInquire whether directory exists; if present and not a directory, trigger an error
assertCorrectIndexprotectedPrint error, if index to last essential character in directory is wrong