getSizeOfFileSystemItem method

int getSizeOfFileSystemItem(
  1. DirectoryItem item, {
  2. bool isThrowException = true,
})

return total size in bytes of file or directory , work on GNU/Linux systems, tested in debian 10

Implementation

int getSizeOfFileSystemItem(DirectoryItem item,
    {bool isThrowException = true}) {
  if (item.type == DirectoryItemType.directory) {
    return getSizeOfDirectory(item.path, isThrowException: isThrowException);
  } else {
    return getSizeOfFile(item.path, isThrowException: isThrowException);
  }
}