Enumerating drives

BlitzMax Forums/BlitzMax Programming/Enumerating drives

Sashnil(Posted 2006) [#1]
Hiyas,

How can i enumerate available drives and network drives in bmax?
or
I need a cross-platform multi select file requestor.

Thanks.


Sashnil(Posted 2006) [#2]
Anyone?


Sashnil(Posted 2006) [#3]
Ok i came up with this, it's not pretty but works great.

For i = 0 To 23
If ChangeDir(Chr(67+i)+":\") = True
Print "CurrentDir()="+CurrentDir()
EndIf
Next


Chris C(Posted 2006) [#4]
I need a cross-platform multi select file requestor.

for linux everthings mounted somewhere on / with a similar situation on mac I think...


Beaker(Posted 2006) [#5]
Improvement on the above code:
For i = 0 To 23
drive$ = Chr(67+i)+":\"
If FileType(drive) = 2
Print "Drive="+drive
EndIf
Next 



Sashnil(Posted 2006) [#6]
cool ty! :)


FlameDuck(Posted 2006) [#7]
On Linux (and Mac I imagine) you should parse /etc/fstab. You're after the value in the second column. A StringTokenizer from the code archives should do you well.