7

Recently I've tried to change the default application with which a file is opened, by doing the following:

  1. Right click on the file

  2. Get info

  3. In "Open with", change to the application you want your file to be opened with.

  4. Click on the "Change All" button which is found under the "Open with" label

in the last step, i.e. when I click on "Change All", I receive the following message:

enter image description here

then if I look at the default application that opens this file, it's really the application I've just chosen, but when I click on the file to open it, I've the following error message:

enter image description here

Yes, I was trying to open a Makefile for a C program.

Any ideas of why this is happening and how to solve it?

1
  • 1
    My hunch is this is failing because there's no file extension.
    – MacManager
    Commented Oct 28, 2016 at 19:59

2 Answers 2

0

I had the same problem, with a set of files that do have an extension (testfile.py). It turned out that there was an (invisible to me) space at the end of the filename "testfile.py ", which was causing the headache. i removed that, and all was fine again.

0

The error that you see is just a security measure of macOS because you probably downloaded some source code from the internet, to compile, of which 'Makefile' is a part of. It's just asking you to be careful and be sure that it is not a malware.

To remove this warning, execute the following command in Terminal on the folder where the code is:

sudo xattr -r -d com.apple.quarantine /path/to/folder/where/code/is

The 'com.apple.quarantine' is a metadata that macOS adds to files downloaded from the internet. This triggers the warning in macOS. Executing the above command removes this metadata from the folder and all files inside it, and thus macOS will henceforth treat all the files as normal (or "safe / trusted").

You must log in to answer this question.