cristiammercado / node-disk-info

Node module to get disk information in Windows, Linux, Mac, FreeBSD & OpenBSD (works with Electron).
MIT License
60 stars 15 forks source link

Wrong disk info on windows #27

Open zwz opened 2 years ago

zwz commented 2 years ago

Here is what I tried:

for(const disk of disks){ ... console.log(disk) ... console.log(disk.filesystem) ... } Drive { _filesystem: 'Local Fixed Disk', _blocks: 0, _used: 0, _available: 0, _capacity: '0%', _mounted: 'C:' } Local Fixed Disk Drive { _filesystem: 'Local Fixed Disk', _blocks: 0, _used: 0, _available: 0, _capacity: '0%', _mounted: 'D:' } Local Fixed Disk Drive { _filesystem: 'Local Fixed Disk', _blocks: 0, _used: 0, _available: 0, _capacity: '0%', _mounted: 'E:' } Local Fixed Disk Drive { _filesystem: 'Local Fixed Disk', _blocks: 0, _used: 0, _available: 0, _capacity: '0%', _mounted: 'F:' } Local Fixed Disk Drive { _filesystem: 'CD-ROM Disc', _blocks: 0, _used: 0, _available: 0, _capacity: '0%', _mounted: 'G:' } CD-ROM Disc undefined

Ekristoffe commented 2 years ago

hi, What windows are you using ? What version of nodeJS ? What version of node-disk-info ? have you try the example code ? What output does it give you ?

zwz commented 2 years ago

I am using Windows7 node 13.14 with the latest version of node-disk-info.

This is the code I tried:

for(const disk of disks){
    console.log(disk)
    console.log(disk.filesystem)
}

And the output was:

Drive {
_filesystem: 'Local Fixed Disk',
_blocks: 0,
_used: 0,
_available: 0,
_capacity: '0%',
_mounted: 'C:'
}
Local Fixed Disk
Drive {
_filesystem: 'Local Fixed Disk',
_blocks: 0,
_used: 0,
_available: 0,
_capacity: '0%',
_mounted: 'D:'
}
Local Fixed Disk
Drive {
_filesystem: 'Local Fixed Disk',
_blocks: 0,
_used: 0,
_available: 0,
_capacity: '0%',
_mounted: 'E:'
}
Local Fixed Disk
Drive {
_filesystem: 'Local Fixed Disk',
_blocks: 0,
_used: 0,
_available: 0,
_capacity: '0%',
_mounted: 'F:'
}
Local Fixed Disk
Drive {
_filesystem: 'CD-ROM Disc',
_blocks: 0,
_used: 0,
_available: 0,
_capacity: '0%',
_mounted: 'G:'
}
CD-ROM Disc
undefined
Ekristoffe commented 2 years ago

could you please use this command in a console (CMD in windows): wmic logicaldisk get Caption,FreeSpace,Size,VolumeSerialNumber,Description /format:list and paste the result here (if it is readable)

Indeed some data seems weird I think I need to check it again (also some changes are already in PR but still not accepted)