createDir function

Future<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

Future<String> createDir(String path, {bool recursive = false}) async =>
    _CreateDir().createDir(path, recursive: recursive);