sparkerman
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2015
01:49 PM
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
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
6 REPLIES 6
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2015
02:31 PM
Re: using the GetVolumeList()
So use GetVolumeList(), don't guess. Just exclude the usual suspects (common:, pkg:, tmp:) 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
sparkerman
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2015
04:38 PM
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...
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...
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2015
05:53 PM
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:
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
sparkerman
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2015
07:46 AM
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.
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.
Komag
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2015
06:56 PM
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
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
norcaljohnny
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2020
03:19 PM
Re: using the GetVolumeList()
While this method failed for me it did get me to think on it more and what I didnt realize for some reason is that it needs to be done in a task component.
So for anyone wondering how to access the usb or volumes available in general.
Create a task and call it from your scene, group or custom component with Brightscript.
m.volumeTask = m.top.FindNode("volumeList") ' to stop the task after it returns the data m.volumeTask.control = "RUN"
Add the node to stop the task.
<volumeReader id="volumeList" control="STOP" />
And the for the task node itself...
sub init() m.top.functionName = "getvolume" end sub sub getvolume() fs = createObject("roFileSystem") print fs.getVolumeList() end sub
This in turn will return your roList as documented.
<Component: roList> = ( "cachefs:" "common:" "ext1:" "ext2:" "pkg:" "tmp:" )
Maybe this help some people who had a misunderstanding such as myself.