disk information

hello everybody

I’want write project get disk information --> total size,free space

On Linux platform

thank you

Get an eye on the properties listed there: FolderItem .

This will work on Linux and OS X:

[code]Dim theShell As New Shell
Dim theVolumesData(-1) As String

theShell.Execute “df -k”
theVolumesData = Split(ReplaceLineEndings(theShell.ReadAll, EndOfLine), EndOfLine)
[/code]
The output will look something like this:

Filesystem 1024-blocks Used Available Capacity iused ifree %iused Mounted on /dev/disk0s2 244781464 184327100 60198364 76% 46145773 15049591 75% / devfs 187 187 0 100% 649 0 100% /dev /dev/disk1s2 732238672 707275024 24963648 97% 176818754 6240912 97% /Volumes/VD 1 map -hosts 0 0 0 100% 0 0 100% /net map auto_home 0 0 0 100% 0 0 100% /home //Tim@homeoffice8/C 243837948 80232744 163605204 33% 0 18446744073709551615 0% /Volumes/C /dev/disk2s2 315276 284004 31272 91% 70999 7818 90% /Volumes/SpeedGrade_CC_7_2_1_ftr
You can look for your specific volume in the resulting string array. You can ignore the entries that start with “devfs” or “map” since they are not real volumes.

Or, if you know that you only want one specific volume, change the “df -k” command to include the volume:

theShell.Execute "df -k " + theVolumeShellPath

That will only return the info about the specified path:

Filesystem 1024-blocks Used Available Capacity iused ifree %iused Mounted on /dev/disk1s2 732238672 707275024 24963648 97% 176818754 6240912 97% /Volumes/VD 1

“df --help” is your friend

Depending the shell output you wish to be returned. :slight_smile:

What is unit of size
byte ?
thank you

depending on which flags you give to df. it could be blocks, KB, MB, etc

Remember, the --help and manages are your friends when it comes to this information:

df --help
man df