Get Freespace on > 2GB drives
This code will return the freespace on a drive even if it exceeds 2GB.
AI
KI-Zusammenfassung: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Quellcode
Public Function GetDriveInfo(DriveName As String) As String
retval = GetDiskFreeSpace_FAT32(Left(DriveName, 2), FB, BT, FBT)
FBT = FBT * 10000 'convert result to actual size in bytes
If FBT / Gigabyte < 1 Then 'If less than 1GB then show as MB
DriveSize = Format(FBT / Megabyte, "####,###,###") & " MB free"
Else 'Show as GB
DriveSize = Format(FBT / Gigabyte, "####,###,###.00") & " GB free"
End If
GetDriveInfo = "[" & DriveSize & "]"
End Function
Originalkommentare (3)
Wiederhergestellt von der Wayback Machine