How to use the systeminformation.blockDevices function in systeminformation

To help you get started, we’ve selected a few systeminformation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tomaschyly / FileCtor / src / main / Api.js View on Github external
let stat = await statPromise (path.join ('/Volumes', files [index]));

								if (stat.isDirectory ()) {
									drives.push ({
										identifier: encodeURIComponent (path.join ('/Volumes', files [index])),
										mount: path.join ('/Volumes', files [index]),
										label: files [index]
									});
								}
							}
						}
					}
					break;
				} 
				default: {
					let devices = await systemInformation.blockDevices ();

					if (Array.isArray (devices) && devices.length > 0) {
						for (let index in devices) {
							if (devices [index].physical === 'Local') {
								drives.push (devices [index]);
							}
						}
					}
				}
			}
		} catch (error) {
			console.error ('TCH_e API - ListDrives - ' + error.message);
		}

		event.sender.send ('drives-list', {
			drives
github nullvoid-creations / Jaya / src-native / services / providers / file-system.service.ts View on Github external
private async GetDriveLetters(): Promise {
        let devices = await Si.blockDevices();

        let letters: string[] = [];
        for (let device of devices)
            letters.push(device.mount);

        return letters;
    }