Skip to content

FileSystemManager.mkdirSync ​

JS
    FileSystemManager.mkdirSync(string dirPath, boolean recursive)

Creates a directory

The synchronous version of FileSystemManager.mkdir

Parameters

  • string dirPath: Path of the directory to create

  • boolean recursive: Whether to recursively create the parent directories of this directory before creating it. If the corresponding parent directory already exists, that parent directory is not created. For example, if dirPath is a/b/c/d and recursive is true, directory a is created, then directory b is created under a, and so on until directory d is created under a/b/c.

Parameters for caught exceptions

  • error: Returns error information. See the figure below for valid values.

Valid values of error:

Error InformationDescription
no such file or directoryParent directory does not exist
permission deniedNo write permission for the specified target file path
file already existsA file or directory with the same name exists