GetDriveTypeA with Mac osX ?

BlitzMax Forums/BlitzMax Programming/GetDriveTypeA with Mac osX ?

Filax(Posted 2005) [#1]
Hi :) is there a command like

Extern "Win32"
Function IGL_GetDriveExist(DrivePath$z) = "GetDriveTypeA@4"
End Extern

under mac osx ?


FlameDuck(Posted 2005) [#2]
Macs don't have drives.


Diordna(Posted 2005) [#3]
First of all, to my knowledge, it doesn't give them letters. However, you can get a list of drives by looking in the /Volumes folder, which is how you access external drives or extra non-startup-disk hardware. Not a clue how you tell the difference, though. If all you want to do is test for writeability, just try to write to it and see if it lets you.


Filax(Posted 2005) [#4]
I'm a little bit confused with my mac mini os :) this is the code that i
use under pc for know if a drive is connected. Is there a function
to do the same think under mac os ? sorry for this noob question
but it's my first mac ...

' ------------------------------
' Test drive connection and type
' ------------------------------
Function IGL_GetDriveList(Parent:IGL_Combo)
Local DriveType:Int
Local DriveIcon:String

For Local Read=65 To 90
DriveType=IGL_GetDriveExist(Chr(Read)+":/")

If DriveType>1 Then
If DriveType=2 Then DriveIcon=IGL_Icon_FLOPPY
If DriveType=3 Then DriveIcon=IGL_Icon_DRIVE
If DriveType=4 Then DriveIcon=IGL_Icon_NETWORK
If DriveType=5 Then DriveIcon=IGL_Icon_CDROM
If DriveType=6 Then DriveIcon=IGL_Icon_RAMDRIVE

Parent.CreateITem(Chr(Read)+":/",DriveIcon)
EndIf
Next
End Function

The function IGL_GetDriveExist is :

Extern "Win32"
Function IGL_GetDriveExist(DrivePath$z) = "GetDriveTypeA@4"
End Extern


Dreamora(Posted 2005) [#5]
No

But you might visit apple page or XCode documentation for further investigation how to ask the OS for all mounts and their types.


Diordna(Posted 2005) [#6]
Looking in the /Volumes/X folder will tell you if a drive with the name X is mounted, but I think that that's about the extent of it.


Filax(Posted 2005) [#7]
OK i think use a temporary method with "/" for the moment ...