-
-
Notifications
You must be signed in to change notification settings - Fork 12
getStorageProperties
xiao edited this page Nov 8, 2025
·
1 revision
get properties of the specific drive.
callback:
fswin.getStorageProperties(path, properties, callback);async:
var result = await fswin.getStoragePropertiesAsync(path, properties);sync:
var result = fswin.getStoragePropertiesSync(path, properties);-
pathis the device path of a drive. which is usually start with\\?\or\\.\. -
propertiesis an object to determine what kind of properties to return. see example for details. -
callbackis a function that takes only one argumentresult. -
resultis an object when the path is accessible or null otherwise.
var fswin = require('fswin');
var path = '\\\\?\\PhysicalDrive0';
var properties = {
deviceProperty: true,
adapterProperty: true,
deviceWriteCacheProperty: true,
accessAlignmentProperty: true,
deviceSeekPenalty: true,
deviceTrim: true,
deviceLBProvisioningProperty: true,
devicePowerProperty: true,
deviceCopyOffloadProperty: true,
deviceMediumProductType: true,
adapterRpmbProperty: true,
deviceIoCapabilityProperty: true,
adapterTemperatureProperty: true,
deviceTemperatureProperty: true,
adapterSerialNumber: true
};
//sync
console.log(fswin.getStoragePropertiesSync(path, properties));
//async
fswin.getStorageProperties(path, properties, console.log);