jDiskMark / jdm-java

1 stars 0 forks source link

Usage and capacity support for non english distributions #22

Open jamesmarkchan opened 7 months ago

jamesmarkchan commented 7 months ago

The fsutil tool output text will vary for non english OS settings:

fsutil volume diskfree e:\
Total de bytes libres:  26,021,392,384 ( 24.2 GB)
Total de bytes: 512,108,785,664 (476.9 GB)
Cuota total de bytes libres:  26,021,392,384 ( 24.2 GB)

and cause usage and capacity to not report correctly. This is was discovered from Albert's test... spanish-language-usage-cap-bug

Need to find a solution that scales. Maybe can just omit capacity reporting for non English usage or add support for different languages.

jamesmarkchan commented 7 months ago

can try PowerShell:

Get-Volume | ForEach-Object {
  $freeSpace = $_.FreeSpace / 1GB -as [Math]::Round
  $totalSpace = $_.TotalSize / 1GB -as [Math]::Round
  $driveLetter = $_.DriveLetter
  Write-Host "$driveLetter: ($freeSpace GB free, $totalSpace GB total)"
}

or

Get-WmiObject Win32_LogicalDisk -Filter "DriveType = 3" | ForEach-Object {
  $freeSpace = $_.FreeSpace / 1GB
  $totalSpace = $_.Size / 1GB
  $driveLetter = $_.DeviceID
  Write-Host "$driveLetter: ($freeSpace GB free, $totalSpace GB total)"
}
jamesmarkchan commented 4 months ago

This also doesn't look right, this was seen after reimaging my PC image