On 01/31/2019 02:03 PM, Thomas Schmitt wrote:
Hi,
Richard Owlett wrote:
What bugs me is Gparted [though it does not output text] reports
used/unused space on each partition/file system.
i wrote:
[...] Gparted runs external programs, which a simple
shell script could do too.
David Wright wrote:
So going back to the OP, is this a sensible approach to choose instead
of letting mount and df figure things out for themselves?
It's what Gparted does and what Richard mentioned as example of the desired
information.
I'd make that statement stronger.
My starting point was Gparted displays *ALL* the desired information for
*ALL* members of the set [ /dev/sd* ] whether mounted or not.
That PROVED that what I wanted was possible.
It's "suitability to purpose" was degraded on *2* counts:
1. it does not output the data as a text file.
2. it displays information for only 1 device at a time.
Given that the source code of Gparted is published, we do not
have to speculate how it does this, but rather can riddle over its C++ code.
Having known working source code for a program that almost meets my
needs/desires remedies a major deficiency of the man page format --
[/begin_rant almost total lack of examples /end_rant ;]
(The ext2 specific code distinguishes between mounted and not mounted
partitions. The FAT related code seems not to do.)
Have a nice day :)
Thomas