lengthSync method

int lengthSync({
  1. bool followLinks = true,
})

The length of all files in this Directory provided synchronously.

Throws a FileSystemException if the operation fails.

Implementation

int lengthSync({
  bool followLinks = true,
}) {
  var len = 0;

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

  return len;
}