moveDir function

Stream<FileLog> moveDir(
  1. Directory dir1,
  2. Directory dir2
)

Recursively copying a file with its contents, and deletes the copied content.

Warning: the first argument File returned is a deleted file.

Implementation

Stream<FileLog> moveDir(
  Directory dir1,
  Directory dir2,
) async* {
  await for (final fl in copyDirRec(dir1, dir2)) {
    fl.file1.deleteSync();
    fl.action = Action.move;
    yield fl;
  }
}