length method

Future<int> length({
  1. bool followLinks = true,
})

The length of all files in this Directory.

Returns a Future<int> that completes with the length of all Files in this Directory in bytes.

Implementation

Future<int> length({
  bool followLinks = true,
}) async {
  var len = 0;

  await for (final item in list(recursive: true, followLinks: followLinks)) {
    if (item is! File) continue;
    len += await item.length();
  }

  return len;
}