Enumerating drives

BlitzMax Forums/BlitzMax Programming/Enumerating drives

Hiyas,

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

Thanks.

Anyone?

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

I need a cross-platform multi select file requestor.

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

Improvement on the above code:
For i = 0 To 23
drive$ = Chr(67+i)+":"
If FileType(drive) = 2
Print "Drive="+drive
EndIf
Next 


cool ty! :)

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.