storage
The storage object provides functions related to the player storage (USB1, SD, SD2, SSD, and/or Flash). This object is available as of BOS 9.0.168.
See this page for more information about device storage paths.
system IDL
[
constructor()
] interface Storage {
Promise<void> eject(String mountPoint);
Promise<void> format(String mountPoint, String fileSystemType);
attribute Array<String> priorityOrder;
};Object Creation
To create a storage object, first load the brightsign/storage module using the require() method. Then create an instance of the storage class.
const Storage = require("@brightsign/storage");
let priorityOrder = new Storage().priorityOrder;Storage
Use this interface to call the following methods:
eject()
Promise<void> eject(String mountPoint)The storage device is prepared for safe removal and may be physically ejected if that is supported by the storage device.
format()
Promise<void> format(String mountPoint, String fileSystemType)Formats the specified drive using one of the file systems listed below:
- vfat (FAT32, DOS/Windows file system): Readable and writable by Windows, Linux, and MacOS.
- exfat (DOS/Windows file system): Supported on Series 3, 4 and 5 players.
- ext2 (Linux file system): Writable by Linux and readable by Windows and MacOS with additional software.
- ext3 (Linux file system): Writable by Linux and readable by Windows and MacOS with additional software.
- ext4 (Linux file system): Writable by Linux and readable by Windows and MacOS with additional software. This is the recommended file system for SSD devices and USB hard drives.
priorityOrder
This read-only property contains the array of storage devices that will be searched by BrightSign OS for autorun scripts in order. Some of these storage devices may not be present on a particular player. For example:
Examples
const Storage = require("@brightsign/storage");
let storage = new Storage();
storage.eject("/storage/sd").then(() => { console.log("SD card can now be removed\n"); } );const Storage = require("@brightsign/storage");
let storage = new Storage();
storage.format("/storage/sd", "vfat").then(() => { console.log("SD card has been formatted\n");});const Storage = require("@brightsign/storage");
let storage = new Storage();
storage.format("/storage/usb1", "exfat").then(() => { console.log("USB card has been formatted\n");});const Storage = require("@brightsign/storage");
let storage = new Storage();
storage.format("/storage/flash", "exfat").then(() => { console.log("LGUV5N internal storage has been formatted\n");});const Storage = require("@brightsign/storage");
let storage = new Storage();
storage.format("/storage/sd2", "exfat").then(() => { console.log("Interal sd storage has been formatted\n");});