[Gambas-user] Disk devices info and management

Fabien Bodard gambas.fr at gmail.com
Tue Dec 29 08:01:12 CET 2020


>From Bruce :

I have been looking around but not found much about getting disk drive
information.

like lsblk

i made a component called gb.shell.tools (very WIP at mo)
https://gitlab.com/bsteers4/gambas/-/tree/gb.shell.tools/comp/src/gb.shell.tools/.src

The premise...
Utilise some linux shell commands for things not so available/easy in
gambas. (afaik)

So far i've added 2 commands that use lsblk to get disk info.
The first a basic ListDisks() that returns a String[] of disk paths
using *lsblk
-lno "PATH"*

The other is LiskBlocks() that returns a DeviceInfo[] array with info lsblk
finds
DeviceInfo.Path
DeviceInfo.Name
DeviceInfo.Type
DeviceInfo.Size
DeviceInfo.ByteSize
DeviceInfo.UUID
DeviceInfo.FSType
DeviceInfo.Label
DeviceInfo.Mountpoint

My questions are...
1. Is there a more gambas way to do this rather than using lsblk so it's
not even needed?

2. Is this a good idea that maybe you could suggest other shell commands
you might want added to a component like this?

3. Is this a terrible idea and i should be looking into external library
functions or a gambas thing
that already exists to get disk info?

If it is better to use an external lib then if someone can point me in the
right direction on using something like liblsblk or some other way to get
disk info i'm up for making a better class.

Cheers anyone
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201229/6b0add27/attachment.htm>


More information about the User mailing list