createDir function

String createDir(
  1. String path, {
  2. bool recursive = false,
})

Creates a directory as described by path. Path may be a single path segment (e.g. bin) or a full or partial tree (e.g. /usr/bin)

createDir("/tmp/fred/tools", recursive: true);

If recursive is true then any parent paths that don't exist will be created.

If recursive is false then any parent paths don't exist then a CreateDirException will be thrown.

If the path already exists an exception is thrown.

As a convenience createDir returns the same path that it was passed.

 var path = createDir('/tmp/new_home');

Implementation

String createDir(String path, {bool recursive = false}) =>
    // ignore: discarded_futures
    waitForEx(core.createDir(path, recursive: recursive));