Page tree
Skip to end of metadata
Go to start of metadata

ON THIS PAGE

The filesysteminfo object provides information about the file system of a storage device connected to the player. To retrieve information about the storage device itself, use the storageinfo object.

filesysteminfo IDL
[
    GarbageCollected,
    constructor(DOMString path)
] interface FileSystemInfo {
    Promise <bool> isReadOnly();
    Promise <DOMString> getFilesystemType();
    Promise <StorageStats> getStatistics();
}

interface StorageStats {
    attribute number blockSize;
    attribute number bytesFree;
	attribute number sizeBytes;
    attribute number filesFree;
	attribute number filesUsed;
    attribute bool isReadOnly;
}

Object Creation

To create a filesysteminfo object, first load the brightsign/filesysteminfo module using the Require() method. Then create an instance of the filesysteminfo class with a string value specifying the storage path.

var FileSystemInfoClass = require("@brightsign/filesysteminfo");
var fileSystemInfo = new FileSystemInfoClass("/storage/sd");

Use the following string values to specify different storage drives:

  • "/storage/usb1" – The drive for USB storage devices connected to the player
  • "/storage/sd" – The primary SD or microSD drive on the player.
  • "/storage/sd2" – The internal microSD drive on the player (4Kx42, XDx32 models only)
  • "/storage/ssd" – The internal SSD on the player (XTx44, XTx43, XDx34, and XDx33 models only)

FileSystemInfo

Use this interface to retrieve information about the file system.

isReadOnly()
Promise <bool> isReadOnly()

Returns a Boolean value indicating whether the filesystem is read-only. 

getFilesystemType()
Promise <DOMString> getFilesystemType()

Returns the filesystem type. The following are potential values:

  • "exfat"
  • "ext3"
  • "ext4"
  • "fat12"
  • "fat16"
  • "fat32"
  • "hfs"
  • "hfsplus"
  • "ntfs"
getStatistics()
Promise <StorageStats> getStatistics()

Returns a StorageStats interface containing information about the filesystem. This method can take a significant amount of time to return its promise.

StorageStats

This interface contains information about the filesystem:

  • [number] blockSize: The size of a native block
  • [number] bytesFree: The amount of free space
  • [number] sizeBytes: The amount of total space
  • [number] filesFree: The number of free inodes
  • [number] filesUsed: The number of used inodes
  • [bool] isReadOnly: A flag indicating whether the filesystem is read-only.

Example

var FileSystemInfoClass = require("@brightsign/filesysteminfo");
var fileSystemInfo = new FileSystemInfoClass("/storage/sd");

fileSystemInfo.getFilesystemType().then(
        function(data) {
            console.log(JSON.stringify(data));
        })
    .catch(
        function(data) {
            console.log(JSON.stringify(data));
        });

fileSystemInfo.getStatistics().then(
        function(data) {
            console.log(JSON.stringify(data));
        })
    .catch(
        function(data) {
            console.log(JSON.stringify(data));
        });

 

  • No labels