---
title: filesysteminfo
slug: develop/filesysteminfo
docTags: 
createdAt: 2025-03-11T07:07:19.526Z
---

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**

```text
[
    constructor(String path, String type);
] interface FilesystemInfo {
    Promise<bool> isReadOnly();
    Promise<String> getFilesystemType();
    Promise<FilesystemStats> getStatistics();
};

interface FilesystemStats {
    attribute Number blockSize;
    attribute Number sizeBytes;
    attribute Number bytesFree;
    attribute Number filesUsed;
    attribute Number filesFree;
    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.

```javascript
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 players that support this (see [Storage Devices](docId\:mGdEFc6YvkIbeiUxH9J1O))
- `"/storage/ssd"` – The internal SSD on players that support this (see [Storage Devices](docId\:mGdEFc6YvkIbeiUxH9J1O))

## FilesystemInfo

Use this interface to retrieve information about the file system.

### isReadOnly()

```javascript
Promise<bool> isReadOnly()
```

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

### getFilesystemType()

```javascript
Promise <DOMString> getFilesystemType()
```

Returns the filesystem type or whether it is encrypted (“+ecryptfs”). The following are potential values:

- "exfat"
- "ext3"
- "ext4"
- "fat12"
- "fat16"
- "fat32"
- "hfs"
- "hfsplus"
- "ntfs"
- “+ecryptfs” (as of BOS version 9.0.145.1)

### getStatistics()

```javascript
Promise<FilesystemStats> getStatistics()
```

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

## FilesystemStats

This interface contains information about the filesystem:

- `blockSize` <font color="#704ae0">Number</font>: The size of a native block
- `sizeBytes` <font color="#704ae0">Number</font>: The amount of total space
- `bytesFree` <font color="#704ae0">Number</font>: The amount of free space
- `filesUsed` <font color="#704ae0">Number</font>: The number of used inodes
- `filesFree` <font color="#704ae0">Number</font>: The number of free inodes
- `isReadOnly` <font color="#704ae0">bool</font>: A flag indicating whether the filesystem is read-only.

## Example

```javascript
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));
        });
```

