Open SrRapero720 opened 3 years ago
I have the same problem. In addition wrong error will be thrown! Just add a line at drive.js:44 to check out
variable and throw related error.
Using this npm module was a waste of time.
At least add a list of supported operating systems!
Update about this I found better documentation about this and possible alternatives (excluding my suggestions).
Get-CimInstance -ClassName Win32_LogicalDisk
get all devices. letter, size and free space (in bytes)Get-Volume
Its less easy to parse and space are converted in GB/MB. but give more info like FileSystem, Health and Operational statusIn addition of that. these commands only works on Powershell and exec still use CMD (idk why) but can be used replacing EXEC with SPAWN
var spawn = require("child_process").spawn,child;
child = spawn("powershell.exe",["c:\\temp\\helloworld.ps1"]);
child.stdout.on("data",function(data){
console.log("Powershell Data: " + data);
});
child.stderr.on("data",function(data){
console.log("Powershell Errors: " + data);
});
child.on("exit",function(){
console.log("Powershell Script finished");
});
child.stdin.end(); //end input
My english is so bad, so I may sound incoherent or rude. So I'll get right to the point. i see in the in
drive.js
you are using df -kP. its a great commant for linux users (and servers) but when you try to run that on Windows console and the spam are inevitableI check on forums and test by myself and i found the "equivalent" of
df -kP
and isget-psdrive –psprovider filesystem
. Actually the command give you the Free Mem, Used Mem and Root, (not root or Administrator permission required)well its posible to get compatibilty. just add a conditional for windows like this (or someting like this) https://github.com/SunilWang/node-os-utils/blob/4136218f8cc79d84974d759bd70b0f067c3790f8/lib/drive.js#L38-L43
i hope you have planed to add windows support on osu.drive. is very strange found good libraries with this feature.