@ed95 The recent commit e65ac0b2 adds the
O_CREAT flag to the open call in
FileInputStream::openHandle(). This breaks existing behaviour on macOS (didn’t check other platforms). Minimal example:
juce::String path ("/doesnotexist.png"); juce::File file (path); juce::FileInputStream stream (file); CHECK_FALSE (stream.openedOk());
Previously, creating the stream would fail. Since this commit, the call to stream ctor will actually create a file on disk. Which breaks the above unit test (and probably the behaviour of some projects built with JUCE).
Is this intentional? If yes, what is the recommended way to get the old behaviour back (i.e. creating a
FileInputStream but without creating a new file if the file does not exist)?
Should the users work around this in client code by adding a check for
if (! file.existsAsFile()) before creating a
Or is this unintentional and should be fixed in JUCE itself?