MacOS Drives

Xojo 2019 R3.1

When I use the following on Mojave

var name as string
Var Drive as FolderItem
For i As Integer = 0 To Drive.LastDriveIndex
  name = Drive.DriveAt(i).Name
Next

I get a drive list as follows:

Macintosh HD
vm
home
net
TimeMachine Jims_iMac
Backup
General

How can I tell which should be presented to a user as part of Folder selection that includes drive? Does the list change with Catalina and BigSur?

By the way, documentation for DriveAt() in 2019 R3.1 is miserable. The example code is uncompilable! It shows

For i As Integer = 0 To App.LastDriveIndex
name = App.DriveAt(i).Name
Next

App is not even a FolderItem! It took me forever, as a novice since RB 0.9, to figure it out! I am finding similar things, over and over, in the LR, plus many, many links that go nowhere! I rely, heavily on the LR and this is very disconcerting.

Jim
James Wagner
Oregon Research Electronics

1 Like

This is my result on BS/M1:

Macintosh HD
VM
Preboot
Update
xarts
iSCPreboot
Hardware
home
1D0FCCA4-83D4-4370-9AAC-ADA3532C81F1
beatrixwillius 1

You don’t know which drives you need to present to the users.

1 Like

Yeah, those are shared methods on the FolderItem class, not App.

Thanks, Beatrix

For the moment, it appears that drives having native paths starting with “/Volumes/” are good bets as well as “/” (and a length of 1). This seems to cover removable media that I have been able to find. Guess that I will find more when the product reaches users. 90% will have Windows and it is easy, there.

Cheers
Jim

Can you check the visible property?

I don’t think so. In my Mohave, vm is has the visible property set. Not sure what that means as it is NOT visible in the Finder. I’d be happy with “Finder Rules”, what ever they are.

Jim

There’s an official way to ask the Mac for volumes that should be hidden for navigation. Please see this thread: List of all Volumes

I just realized that SpecialFolder.UserHome will do what I need when combined with SelectFolderDialog.

So, for me, this issue is closed. Thanks everyone for their great suggestions.

Jim

James Wagner
Oregon Research Electronics