moveDir function

void moveDir(
  1. String from,
  2. String to
)

Moves or renames the from directory to the to the to path.

The to path must NOT exist.

The from path must be a directory.

moveDir first tries to rename the directory, if that fails due to the to path being on a different device we fall back to a copy/delete operation.

moveDir("/tmp/", "/tmp/new_dir");

Throws a MoveDirException if: the from path doesn't exist the from path isn't a directory the to path already exists.

Implementation

void moveDir(String from, String to) => waitForEx(
    // ignore: discarded_futures
    core.moveDir(from, to));