Player APIs (BrightScript & Ja...
...
Hashing and Storage Objects
roStorageInfo
9 min
this object is used to report usage information for storage devices see technical best practices docid\ qceva3ocmvet4jzt5l6pe for more information about device storage paths 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) "flash " the flash storage of the player 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 true false 174false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type example si=createobject("rostorageinfo", "sd /") print si getfreeinmegabytes(); "mib free"