Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
sparkerman
Level 7

using the GetVolumeList()

How can you find the available USB drives available using the GetVolumeList()?
I noticed some flash drives need a path using "ext1" and some use "ext2". I think this depends on how the USB drive is formatted. I want to make sure I have the right URL path before I start playing the video on the USB drive.
Thanks
0 Kudos
5 Replies
EnTerr
Level 8

Re: using the GetVolumeList()

So use GetVolumeList(), don't guess. Just exclude the usual suspects (common:, pkg:, tmpSmiley Happy and whatever remains is external drive. Btw, i suspect with a USB hub more than 1 devices can be connected so you may get both ext1 and ext2 simultaneously
0 Kudos
sparkerman
Level 7

Re: using the GetVolumeList()

How do you use the GetVolumeList()?
I understand it's an object containing a list of available USB drives. How would I go about using brightscript to achieve this? I understand other languages such as PHP, but I'm having a hard time finding examples for brightscript. I've gone through the SDK examples but would like to find a simple "bare bones" example.
If I use a MAC OS Extended (Journaled) USB drive, I need to use ext2 but if the USB is formatted as MS-DOS (FAT) it only works using ext1. I wonder why that is...
0 Kudos
EnTerr
Level 8

Re: using the GetVolumeList()

BrightScript is a dialect of BASIC (like Visual Basic is). Learn it. Is not worse than PHP.

Something like this should do:
fs = createObject("roFileSystem")
usb_drive = invalid
for each vol in fs.getVolumeList():
if left(vol, 3) = "ext" then usb_drive = vol
end for
0 Kudos
sparkerman
Level 7

Re: using the GetVolumeList()

Thanks!
These simple bare bones examples is what I was looking for. I would have never thought of creating an roFileSystem first. Everything else make complete sense.
Thanks again for your help.
0 Kudos
Komag
Level 9

Re: using the GetVolumeList()

Bookmark this: http://sdkdocs.roku.com/display/sdkdoc/ ... umentation
Then read it "all", and do searches there
A quick search for getvolumelist returns link to ifFileSystem page: http://sdkdocs.roku.com/display/sdkdoc/ifFileSystem
0 Kudos