File::isOnRemovableDrive() does not appear to work on MacOSX


It appears that File::isOnRemovableDrive() does not work on MacOSX. I am trying to determine which folders (drives) in /Volumes/ are external drives. This is because on MacOSX, the internal root drive (often called Macintosh HD) can be located in “/Volumes” and I would like to skip it while scanning external drives in this location. I currently have 3 external drives connected to my computer so my /Volumes directory looks something like this:

  1. /Volumes/Macintosh HD/
  2. /Volumes/extDrive1/
  3. /Volumes/extDrive2/
  4. /Volumes/extDrive3/

File::isOnRemovableDrive() returns false for all directories even though 3 are removable/ejectable external drives. Is there a better way to determine on Mac OSX which drives in “/Volumes” are removable (external) drives? My goal is to only scan external drives on MacOSX.

Thanks in advance!

Here’s how I do it in a shell script, maybe you can see some path between:

for i in /dev/disk*
    diskutil info $i | grep Ejectable

Some code to do it mentioned here, not sure how effective it would be to include it in Juce, but maybe you can make a module for your needs:

I am hitting this too, can this be fixed please, or is that fixed past 7.0.5?

isOnRemovableDrive() returns false for USB drives/sticks on MacOS. I try to write a better file browser and for that it would be crucial that the juce functions provide correct information.

Apologies, it works as expected. I messed up with isOnHardDrive().