psutil icon indicating copy to clipboard operation
psutil copied to clipboard

disk_partitions(): add disk type info (ssd / rotational)

Open giampaolo opened this issue 4 years ago • 1 comments

Summary

  • OS: all
  • Type: new-api

Description

An extra "disktype" field could be added to the retuned namedtuple indicating whether the partition refers to an SSD or a rotational disk drive.

The value should be a string like "ssd", "rotational" or "" / None (undefined).

This new value could be particularly useful to identify (and filter for) real disks/partitions, because the result returned by disk_partitions() is unclear on what's "real" and what's "virtual".

Here's another use case: https://stackoverflow.com/questions/30647758/in-python-can-i-see-if-a-file-lives-on-an-hd-or-an-ssd)

giampaolo avatar Oct 26 '21 20:10 giampaolo

Also, https://github.com/giampaolo/psutil/issues/1681 / https://github.com/giampaolo/psutil/pull/1694 must be taken into account. Should psutil.disk_swaps() also return this new field?

giampaolo avatar Oct 26 '21 20:10 giampaolo