Player APIs (BrightScript & Ja...
...
Object Reference
Hashing and Storage Objects

roStorageInfo

8min
this object is used to report usage information for storage devices object creation the rostorageinfo object is created with a parameter that specifies the path of the storage device the path does not need to extend to the root of the storage device the javascript equivalent is filesysteminfo docid\ qulnl7zrhwc5fgokcgai7 and storageinfo docid\ roz3o77euxtyzvj dspin (see brightscript javascript migration guide docid 2kewwxlmpycwu8tffuf2z for the method equivalents) createobject("rostorageinfo", path as string) drive specifications use the following string values to specify different storage drives "usb1 " – the drive for usb storage devices connected to the player "sd " – the primary sd or microsd drive on the player "sd2 " – the internal microsd drive on the player (4kx42, xdx32 models only) "ssd " – the internal ssd on the player (xtx44, xtx43, xdx34, and xdx33 models only) ifstorageinfo getfailurereason() as string yields additional useful information if a function return indicates an error getbytesperblock() as integer returns the size of a native block on the filesystem used by the specified storage device getsizeinmegabytes() as integer returns the total size (in mebibytes) of the storage device on some filesystems that have a portion of space reserved for the super user, the following expression may not be true getusedinmegabytes() + getfreeinmegabytes() == getsizeinmegabytes() getusedinmegabytes() as integer returns the amount (in mebibytes) of space currently used on the storage device this amount includes the size of the pool because this class does not integrate pools into its calculations getfreeinmegabytes() as integer returns the available space (in mebibytes) on the storage device getfilesystemtype() as string returns a string describing the type of filesystem used on the specified storage 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) getstoragecardinfo() as roassociativearray returns an associative array containing details of the storage device hardware for sd cards, the returned data may include the following sd mfr id integer card manufacturer id as assigned by the sd card association sd oem id string two character card oem identifier as assigned by the sd card association sd product name string product name, assigned by the card manufacturer (5 bytes for sd, 6 bytes for mmc) sd spec vers integer version of sd spec to which the card conforms sd product rev string product revision assigned by the card manufacturer sd speed class string speed class (if any) declared by the card sd au size integer size of the sd au in bytes example si=createobject("rostorageinfo", "sd /") print si getfreeinmegabytes(); "mib free"