From 48b35c447ab68f464b9cc0a006ffcf5b7908c83d Mon Sep 17 00:00:00 2001 From: jules Date: Thu, 14 Apr 2016 12:43:32 +0100 Subject: [PATCH] Workaround for long filenames in Process::openDocument on OSX --- modules/juce_core/native/juce_mac_Files.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/juce_core/native/juce_mac_Files.mm b/modules/juce_core/native/juce_mac_Files.mm index c5614e6ba5..564ccc7ec0 100644 --- a/modules/juce_core/native/juce_mac_Files.mm +++ b/modules/juce_core/native/juce_mac_Files.mm @@ -414,8 +414,10 @@ bool JUCE_CALLTYPE Process::openDocument (const String& fileName, const String& NSWorkspace* workspace = [NSWorkspace sharedWorkspace]; if (parameters.isEmpty()) - return [workspace openFile: juceStringToNS (fileName)] - || [workspace openURL: filenameAsURL]; + // NB: the length check here is because of strange failures involving long filenames, + // probably due to filesystem name length limitations.. + return (fileName.length() < 1024 && [workspace openFile: juceStringToNS (fileName)]) + || [workspace openURL: filenameAsURL]; const File file (fileName);