diff --git a/block.go b/block.go index cdbdeb45..346d2016 100644 --- a/block.go +++ b/block.go @@ -109,13 +109,14 @@ type Disk struct { // Partition describes a logical division of a Disk. type Partition struct { - Disk *Disk `json:"-"` - Name string `json:"name"` - Label string `json:"label"` - MountPoint string `json:"mount_point"` - SizeBytes uint64 `json:"size_bytes"` - Type string `json:"type"` - IsReadOnly bool `json:"read_only"` + Disk *Disk `json:"-"` + Name string `json:"name"` + Label string `json:"label"` + MountPoint string `json:"mount_point"` + SizeBytes uint64 `json:"size_bytes"` + UsableBytes uint64 `json:"usable_bytes"` + Type string `json:"type"` + IsReadOnly bool `json:"read_only"` } // BlockInfo describes all disk drives and partitions in the host system. diff --git a/block_windows.go b/block_windows.go index defac106..4a1f0b2c 100644 --- a/block_windows.go +++ b/block_windows.go @@ -122,12 +122,13 @@ func (ctx *context) blockFillInfo(info *BlockInfo) error { if logicaldisktodiskpartition.Antecedent == desiredAntecedent && logicaldisktodiskpartition.Dependent == desiredDependent { // Appending Partition p := &Partition{ - Name: logicaldisk.Caption, - Label: logicaldisk.Caption, - SizeBytes: logicaldisk.Size, - MountPoint: logicaldisk.DeviceID, - Type: diskpartition.Type, - IsReadOnly: toReadOnly(diskpartition.Access), // TODO: add information + Name: logicaldisk.Caption, + Label: logicaldisk.Caption, + SizeBytes: logicaldisk.Size, + UsableBytes: logicaldisk.FreeSpace, + MountPoint: logicaldisk.DeviceID, + Type: diskpartition.Type, + IsReadOnly: toReadOnly(diskpartition.Access), // TODO: add information } disk.Partitions = append(disk.Partitions, p) break