FileSystem.findFileSystemRoots() returns no attached drives on MacOS
-
@Christoph-Hart FileSystem.findFileSystemRoots() works as expected on Windows, but on MacOS, it doesn't return any attached drives, making it impossible to browse them.
-
@Christoph-Hart, Any chance of having this fixed in the near future, please?
-
@gorangrooves yeah I looked into it, there's not much I can do here, it's default macOS behaviour (if you search in the JUCE forum there are others with the same problem).
-
@Christoph-Hart So, is this a JUCE bug? Obviously, countless Mac apps can access all connected drives, so this can't be impossible on Mac.
-
@gorangrooves sure you can access them, browse with a native file browser and load them but the function that queries all system roots doesn‘t include external disks apparently.
-
So looked again, and it seems that macOS is simply not supposed to return the list of volumes when you query the root.
But you can do this:
const var f = FileSystem.fromAbsolutePath("/Volumes"); const var l = FileSystem.findFiles(f, "*", false);
-
@Christoph-Hart Thank you. Browsing with a native file browser is not really an option since this is for an integrated file browser
Your solution seems promising. Let me see if I can implement that. I'll report back.
-
@Christoph-Hart I am delighted to report that the method you provided here works like a charm! Thank you so much!
For anyone using it, just remember to set the condition that if
Engine.getOS() == "OSX"
use the method above and place those variables as 'var' inside the condition.
-
-