FileChooser::getResults returns path with inconsistent backslash count


I found that FileChooser::getResults returns different path string between single and multiple files selected:

Call FileChooser::browseForMultipleFilesToOpen to open dialog. Select single file, the return content of getResults look as below:

  • C:\Windows

But when select multiple files, the content of getResults look as below:

  • C:\\Windows
  • C:\\ProgramsData

The backslash count is not the same. Although both are valid file path, is this expected behavior?

Hi sam,

I’ve tried to reproduce this but I get a consistent path string with a single backslash from getResults for both single and multiple files selected. Could you post some code to demonstrate this?


Hi @ed95,

I did more tests and look likes this problem only happen when choosing file from removable storage. Below is the system information and code snippets (using JUCE Unit Test).

  • Windows 10
  • JUCE 4.3.0
  • F: is removable disk (SD Card)
  • idrotate.exe is a file on F:

When choose only idrotate.exe, the test will pass. If choose idrotate.exe along with other file, the test will fail.

class FileChooserTest : public UnitTest
		: UnitTest("FileChooserTest")

	void runTest() override
		FileChooser fc("Test",
		Array<juce::File> picked = fc.getResults();

@sam yep, thanks for the code I can reproduce this now. Looks like it happens when you select multiple files located on the root of a drive. I’ll take a look at it.


Should be fixed on develop now.


Yes. I confirmed the issue is fixed in develop branch. Thank you!

1 Like