Shell Tools (but is it needed?)
Posted: Monday 28th December 2020 1:19pm
I have been looking around but not found much about getting disk drive information.
like lsblk
i made a component called gb.shell.tools
https://gitlab.com/bsteers4/gambas/-/tr ... 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
like lsblk
i made a component called gb.shell.tools
https://gitlab.com/bsteers4/gambas/-/tr ... 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