sudo fs_usage -f pathname -w com.apple.IconServicesAgent |grep open
(Terminal will be running an endless loop, but make a note of the file name and path. Close Terminal with cmd-Q)
Open terminal and use path to open file.
Here an error message tells me a directory is “permission denied”.
Make directory open by chmod 755 T (T is the name of the directory that was not open for write)
Problem solved here.