Closed sqweek closed 6 years ago
The OSX impl has an explicit error when the selected file is not representable (see cocoa/dlg.go:fileDlg), although I've never actually been able to trigger it. Having such an error on the public API may be a solution, although I think it's better if we can prevent invalid selections in the first place.
Haha was about to go to bed, went to close my browser tab for BROWSEINFO then saw the BIF_RETURNONLYFSDIRS flag.
The directory browser on windows lets you choose certain shell folders such as "This PC" or attached MTP devices, which don't have an actual file system path.
The result is
Browse()
returns an empty string and no error, which I think is a surprising result. We should make sure to return a valid filename in the no error case.