Shell Tools (but is it needed?)
Posted
#1
(In Topic #529)
Guru

like lsblk
i made a component called gb.shell.tools
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 ListBlocks() 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 this component?
3. Is this a terrible idea and i should be looking into external library functions to get disk info?
Cheers anyone
Bruce
Posted
Regular

Take a look at the command: df
…this may add something to your info.
Posted
Guru

stevedee said
Looks like a good idea to me Bruce.
Take a look at the command: df
…this may add something to your info.
Thanks Steve , df looks similar,
I'm going to look into making it BSD functional too as that's all Ben has commented about it so may be a thing that could be useful.
Am thinking about somehow making it customisable so it has functions that could easily split a shell commands output into an array or something.
1 guest and 0 members have just viewed this.


