How to get the name and size of all disks whether mounted or not in c++
Advertisements I need a way to get the name and size (in megabytes if possible) of all disks in C++ on Linux (Arch to be specific). >Solution : You can simply read files from /sys filesystem. For example on my machine: chus@kagi:~$ cat /sys/block/nvme0n1/size 2000409264 Just open the file, read the number in, multiply by… Read More How to get the name and size of all disks whether mounted or not in c++