6118
Work-around: IDL cannot access files in Documents, Desktop, or External Drives on Mac OS Catalina (10.15)
Background on the issue:
With the release of Mac OS Catalina in 2019, Apple introduced a new file system structure with a stronger emphasis on security. Third-party applications are now required to prompt the user for explicit access to various system and user folders. This adjustment has not yet been implemented into IDL and you may run into permission-related issues when trying to access specific files or folders on your computer through IDL. This is a known issue that impacts other applications on Mac OS, not just IDL.
Symptoms of the issue:
- You have Mac OS 10.15 or higher installed on your computer with ANY version of IDL
- You receive permission-related or confusing "file does not exist" errors when attempting to access files to read or write in the following locations:
- Documents
- Desktop
- Downloads
- External Drives
Examples of the issue:
- Trying to CD into a restricted location will give an error:
IDL> CD, '/Users/YourUsername/Desktop'
% Unable to get working directory.
No such file or directory
2. Using DIALOG_PICKFILE on the affected folders will shown no files, even though files exist there:
IDL> DIALOG_PICKFILE(PATH='/Users/YourUsername/Desktop')
*Dialog window appears with no files or subfolders shown*
3. Attempting to use any reading or writing routines for file access to those locations will result in an error:
IDL> NCDF_GET, '/Volumes/PortableSSD/Data/test.cdf', 'data', data
Error in ncdf_get: NCDF_OPEN: Unable to open the file "/Volumes/PortableSSD/Data/test.cdf". (NC_ERROR=-31)
Work-arounds:
1. Launch IDL from an Apple terminal, not the icon. The issue stems from the user not being adequately prompted to authorize file access when launching IDL or IDLDE from the program icons. If you launch IDL directly from an Apple terminal and then try to read/write to a restricted location from within IDL, you will be prompted to allow access for "Terminal". Make sure to "Allow" this access. After doing so, you should be able to read/write to those locations normally.
To launch IDL from an Apple terminal, open a fresh terminal and enter the following:
cd /Applications/harris/idl88/bin
./idlde (for the IDL Workbench)
./idl (for IDL Command Line)
Once you run this the first time, you will be able to turn permissions on and off in the Preferences > Security & Privacy > Privacy settings under the app called "Terminal". See the screenshot below.

NOTE: You must continue to launch IDL from the terminal for the work-around to work. It isn't a one time fix.
2. Store your data in another location. The file access issue only impacts certain directories on the system. Thus, a work-around could be to make sure your data access occurs in another location outside of the restricted folders. For example, /Users/YourUsername/YourDataFolder.
Created by BCNA on 8/17/20 | Reviewed by MM on 8/17/20